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

Support using config files from user machine for container init when using remote setups #996

Open
QAston opened this issue Apr 11, 2024 · 5 comments
Assignees

Comments

@QAston
Copy link

QAston commented Apr 11, 2024

Is your feature request related to a problem?

It'd be great to be able to run some code that uploads configuration files from the host to the devpod. This works with local docker devpod runs, initializeCommand can copy the files to dockerfile context and the data can then be uploaded via dockerfile. Sadly, this doesn't work for remote environments because initializeCommand and docker build are all run remotely, not on the machine with devpod cli and configuration files.

Which solution do you suggest?

Build and run docker images on the machine with devpod-cli or add a separate hook that allows uploading files from the host to the remote for this purpose. Similar to how some user files are already propagated (docker, ssh), but customizable.

Alternatively add some other type of custom hook that runs on the machine with devpod cli, so we can ssh/scp the files ourselves.

Which alternative solutions exist?

  • Wrap devpod cli in a script that uploads config files and make sure users don't forget to run it - this is the workaround we're currently using
@pascalbreuninger
Copy link
Member

Hi @QAston, sounds like a good addition. We've discussed adding an --additional-files flag to devpod up which would

  1. Stream these files to the remote machine
  2. Mount them into the devcontainer
  3. Expose them to lifecycle commands

This would also solve your problem, right?

@QAston
Copy link
Author

QAston commented Apr 12, 2024

In case we want to be able to run some logic as well to select/prepare files, so I'd personally prefer a custom hook in the config file, similar to the existing hooks but guaranteed to be run on the devpod cli machine. Just having a flag that has to be manually added doesn't provide much over our current approach of wrapping the cli and scp in the wrapper script.

@pascalbreuninger
Copy link
Member

fair enough. Be aware that if you rely on the customization to spin up your environment correctly you'd loose the ability to create workspace with other supporting tools and you'd expect everybody to have these files on their machines outside of your git repository. This basically creates a loop where you'd now have to standardize the environment again

@QAston
Copy link
Author

QAston commented Apr 12, 2024

In our case this is for optimistically forwarding configuration like git user.name user.email and similar. People have ability to customize and add more options by making a branch of the repository with the devpod config. If the current host-init (initializeCommand) step is not a threat to standardizing the enrionment, a devpod specific step shouldn't be a bigger problem.

Essentially, devpods already do this for docker and ssh-agent and git crednetial helper, it'd be nice to have something that covers custom systems.

@euven
Copy link

euven commented Apr 17, 2024

Hi @QAston, sounds like a good addition. We've discussed adding an --additional-files flag to devpod up which would

1. Stream these files to the remote machine

2. Mount them into the devcontainer

3. Expose them to lifecycle commands

This would also solve your problem, right?

This would solve our problem! :)

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

4 participants