devpod icon indicating copy to clipboard operation
devpod copied to clipboard

Agent Url Override

Open MaGaudin opened this issue 1 year ago • 7 comments

What happened?
We are trying to use DevPod with AWS as provider. Our VPC does not have internet connectivity (just for few addresses). So, we are trying to override Agent Url with something else. In particular, We download the agent from github and we experimented Bitbucket, AWS Codecommit and AWS S3 presigned URL.

Unfortunately, we always receive errors and we are not able to start dev pod correctly. For example, with AWS S3 presignedUrl We recieved an error saying that the url is too long and not found error trying to launch sh commands on that URL. Clearly, the system is not able to use the generated url correctly.

What did you expect to happen instead?
to override the Agent Url and start a devpod agent on EC2

How can we reproduce the bug? (as minimally and precisely as possible)
Put the agent on an S3 bucket, create a presignedUrl and copy the url in Agent URL Override section.

Local Environment:

  • DevPod Version: 0.5.6
  • Operating System: windows

DevPod Provider:

  • Cloud Provider: aws
  • Local/remote provider: docker | ssh

MaGaudin avatar May 29 '24 08:05 MaGaudin

Hey @MaGaudin, thanks for opening the issue. You're right, overwriting the agent URL with presigned URLs won't work because DevPod tries to download the binary for the current VM architecture by appending devpod-linux-$ARCH to the DEVPOD_AGENT_URL environment variable.

We could substitute ${BIN_NAME} in the URL to make this work

pascalbreuninger avatar Jun 03 '24 06:06 pascalbreuninger

Hi @pascalbreuninger ,

thank you so much for your reply. Are you going to implement this modification? Or, is there something that we can do (using the console) to implement what you're saying?

MaGaudin avatar Jun 03 '24 08:06 MaGaudin

@MaGaudin I've linked a PR with an implementation, will kick off an alpha release for you to test the changes after tests pass. edit: here we go https://github.com/loft-sh/devpod/releases/tag/v0.5.13-alpha.0

You'll need to pass in the agent url through the DEVPOD_AGENT_URL environment variable and can then add ${BIN_NAME} as a placeholder. Make sure to escape the dollar sign if you're on the command line so prevent the shell variable expansion.

example: export DEVPOD_AGENT_URL=https://s3.amazonaws.com/bucket/test/\${BIN_NAME}?q=somekeyhere

pascalbreuninger avatar Jun 03 '24 18:06 pascalbreuninger

Hi @pascalbreuninger,

you were really kind. I downloaded the alpha version of DevPod but, after overriding the Agent Url as below: image

I had the same error as before: image

Am I doing something wrong?

Marco

MaGaudin avatar Jun 05 '24 09:06 MaGaudin

Is there any update? @pascalbreuninger

MaGaudin avatar Jun 20 '24 14:06 MaGaudin

Hey @MaGaudin, can you try again with the latest release please? :)

pascalbreuninger avatar Sep 02 '24 07:09 pascalbreuninger

Hey @pascalbreuninger, now i have a different error that is: Content Deadline exceeded exception. Any advise on how to solve this? :)

MaGaudin avatar Sep 06 '24 15:09 MaGaudin

@MaGaudin devpod now supports extending the agent download timeout, could you try setting AGENT_INJECT_TIMEOUT to something like 60 seconds and try again? i.e. devpod context set-options -o AGENT_INJECT_TIMEOUT=60

bkneis avatar Oct 07 '24 10:10 bkneis

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Dec 07 '24 02:12 github-actions[bot]