Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrk install issue - behind proxy? #25

Open
andreagalle opened this issue Nov 4, 2023 · 4 comments
Open

wrk install issue - behind proxy? #25

andreagalle opened this issue Nov 4, 2023 · 4 comments

Comments

@andreagalle
Copy link

I've been using your wonderful ws for 1yr at work, as well as for personal projects, but this is the very first time I try out the wrk install coommand to try out couple Apps. I get, for any app, the following error:

11:39:18 with abc in ~p ➜ docker
zsh: command not found: docker
11:39:22 with abc in ~p ➜ wrk install docker==24.0.4-isolate
🛑 App or app version not found
11:39:46 with abc in ~p ➜ wrk install gpt                   
🛑 App or app version not found

This error 🛑 App or app version not found seems to me related to proxy issues, probably, since I experience it when I run the above comamnd from my company workstation and not from home. Is there the possibility to pass the wrk install command the proxy settings?

Within my workspace, all the corresponding environments variable are properly configured:

11:43:44 with abc in ~p ➜ env | grep -i proxy                  
HTTPS_PROXY=http://xxx.xx.xxx.xx:8080
no_proxy=xxx.xx.xxx.xx
NO_PROXY=xxx.xx.xxx.xx
https_proxy=http://xxx.xx.xxx.xx:8080
http_proxy=http://xxx.xx.xxx.xx:8080
HTTP_PROXY=http://xxx.xx.xxx.xx:8080

Wouldn't be a good idea to redirect stderr to stdout too once the installation script is ran?

@andreagalle
Copy link
Author

Neither setting up the following directory:

Acquire::http::Proxy "http://yourproxyaddress:proxyport";

into a file within the directory here below, solves this issue.

/etc/apt/apt.conf.d/

@andreagalle
Copy link
Author

andreagalle commented Nov 6, 2023

I confirm it is the proxy, since I am getting:

10:37:41 with abc in ~p ➜ curl https://api.alnoda.org/api/v1/app/docker/24.0.4-isolate/meta/   
curl: (56) Received HTTP code 503 from proxy after CONNECT

that indicates the fetch at this line is failing. Tell me if you need me to add the -v opt.

While the same curl from outside the container (with proxy properly configured) gives the following supposedly correct output:

{"id": "docker", "name": "Docker", "description": "Install Docker in the workspace", "tags": ["docker"], "repository_url": "", "website": "", "image_url": null, "doc_url": "https://docs.docker.com/", "added_by": "fwubhiaz", "added_by_name": "bluxmit", "created_at": "2023-07-14T11:44:38.076Z", "updated_at": "2023-07-14T11:44:38.076Z", "version_id": 958, "version_code": "24-0-4-isolate", "version": "24.0.4-isolate", "install_script": "# Docker\r\n\r\nsudo apt-get update\r\nsudo apt-get install -y apt-transport-https ca-certificates gnupg lsb-release \r\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \r\necho \"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null \r\nsudo apt-get update \r\nsudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin\r\n\r\n# Docker rootless\r\nsudo apt-get update  \r\nsudo apt-get install -y iproute2\r\n\r\nsudo sh -eux <<EOF\r\n# Install newuidmap & newgidmap binaries\r\napt-get install -y uidmap\r\n# Load ip_tables module\r\nmodprobe ip_tables\r\nEOF\r\n\r\n/usr/bin/dockerd-rootless-setuptool.sh install --skip-iptables\r\n\r\nwrk env XDG_RUNTIME_DIR \"/home/abc/.docker/run\"\r\nwrk env DOCKER_HOST \"unix:////home/abc/.docker/run/docker.sock\"\r\nsudo usermod -aG docker abc  \r\nwrk alias docker \"docker -H unix:///home/abc/.docker/run/docker.sock\"\r\n\r\n# Docker compose\r\ncd /tmp\r\nsudo curl -L \"https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)\"  -o /usr/local/bin/docker-compose\r\nsudo mv /usr/local/bin/docker-compose /usr/bin/docker-compose\r\nsudo chmod +x /usr/bin/docker-compose", "start_script": "rm /home/abc/.docker/run/docker.pid || true; export XDG_RUNTIME_DIR=/home/abc/.docker/run; PATH=/usr/bin:/sbin:/usr/sbin:$PATH dockerd-rootless.sh  --iptables=false", "app_port": null, "ui_path": "", "remarks": "!!! INFO !!!\r\nThis is a Docker [+ Compose] which is isolated from the host. Workspace will run its own rootless docker daemon. \r\n\r\nCompared to the Docker-host version of Alnoda Docker app, stadalone isolated docker daemon will require additional resources.\r\n\r\nIf you want to connect to the host Docker daemon from the workspace instead, install \"host\" version of Alnoda Docker app", "version_created_at": "2023-08-16T11:51:42.942Z", "version_updated_at": "2023-08-16T11:51:42.942Z", "version_added_by": "fwubhiaz"}

@andreagalle
Copy link
Author

It finally worked, once I set up the http_proxy and https_proxy environment variables (switching to another proxy).

10:41:08 with abc in ~p ➜ export http_proxy=http://username:password@yourproxyaddress:proxyport
10:41:26 with abc in ~p ➜ export https_proxy=http://username:password@yourproxyaddress:proxyport
10:41:30 with abc in ~p ➜ wrk install docker==24.0.4-isolate                                             
✨ starting...
⚠️ Please DO NOT close this terminal window untill app is fully installed!
➡️ checking workspace compatibility...
➡️ checking app compatibility...
➡️ executing installation script...
✔️ app installed
➡️ setting startup configuration...
-------------------------------------------------------------
- ⚠️ application will start after workspace is restarted ⚠️  -
---       restart workspace with    'wrk kill'             ---
-------------------------------------------------------------
➡️ adding workspace tags...
❗ Could not update workspace app history at alnoda.org: Not authenticated at alnoda.org
---- ⚠️ RESTART TERMINAL REQUIRED TO APPLY CHANGES ----
✍️ If app is not working try restarting terminal window or entire workspace
🚀 done
R E S T A R T    T E R M I N A L    N O W   (CTRL+D) !!!!!!!!
***********************************************
!!! INFO !!!
This is a Docker [+ Compose] which is isolated from the host. Workspace will run its own rootless docker daemon. 

Compared to the Docker-host version of Alnoda Docker app, stadalone isolated docker daemon will require additional resources.

If you want to connect to the host Docker daemon from the workspace instead, install "host" version of Alnoda Docker app
***********************************************
10:42:06 with abc in ~p took 33s ➜ 

Just to recap: setting up HTTP_PROXY and HTTPS_PROXY was not resolving as well as setting up the proxy under the following path /etc/apt/apt.conf.d/

@andreagalle
Copy link
Author

andreagalle commented Nov 7, 2023

Unfortunately even though the installation was complete, no docker was installed within the system. I tried out the other docker versions too, without success. Running single commands from your # Install script guide, I get the following error:

14:32:19 with abc in ~p took 1m 12s ➜ sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'docker-ce' has no installation candidate
E: Unable to locate package docker-ce-cli
E: Unable to locate package containerd.io
E: Couldn't find any package by glob 'containerd.io'
E: Couldn't find any package by regex 'containerd.io'
E: Unable to locate package docker-compose-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant