-
Notifications
You must be signed in to change notification settings - Fork 227
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
Feature Dependencies - installsAfter not respected #163
Comments
Thank you for your insights. The extend in which we want to incorporate some notion of loose/strong dependencies (if any) has been a topic of discussion for a while now. This is a valuable perspective. The reference implementation and proposed spec provides an
|
Ah, I wasn't aware of the Thanks for the reply! |
Please feel free to update us on whether |
Will do. I do have further feedback, related to installations into the user's home directory and also secrets, but I'll raise those with separate issues. |
Yep, looks like a small typo after some refactoring. We'll be pushing changes shortly, and then afterwards please let us know your feedback :) |
Transferred issue to CLI repo since this is a bug verses a spec change at the moment. |
Hello, I tried running using the latest (HEAD) version and found that I've created a test feature project, It has a feature which installs a Python package using The test feature's Please take a look to see whether I'm doing something wrong, or whether my understanding of Thanks. |
I just recently fixed an issue with the implementation of Was that your understanding? |
Hi @edgonmsft Ah ha! Yes, I assumed they would be added to the list automatically. I suppose having the feature dependencies automagically added presents many more challenges, so I understand now why it's implemented as a soft dependency instead. I've updated my example feature's test to use a I have one scenario to include the |
^^ For the test changes see PR devcontainers/features#1 |
I think for this one the name in |
@edgonmsft Did we come to a conclusion on this one? |
Hi! Sorry for the delay responding here.
cc @joshspicer, @Chuxel, @samruddhikhandale, @chrmarti, @alexdima on your opinions on the best way forward for this scenario. |
Ok - so:
|
Just linking devcontainers/spec#109 which looks like it covers similar ground to this |
Thanks for pointing that out - I moved that issue to the spec repo for discussions on the composite topic. |
Hey @virtualstaticvoid just to let you know that @joshspicer just merged a change that should support your scenario. |
Hi @edgonmsft Okay, I've updated my test repo with the changes to 🎉 The global scenario test is passing now; installing the python feature dependency prior to running the "pip" test. Thanks! |
Awesome! Keep the feedback coming! |
As part of endgame, I tried running through the readme in https://github.com/virtualstaticvoid/devcontainers-cli-issue-163, but I encountered the following issue when trying to run the tests inside of the devcontainer:
Are there alternative verification steps for this issue? |
Hi @rzhao271 Only running global scenarios worked, as can be seen in the automated tests in the repository. I had to explicitly remove running individual feature test, which explains the error you are getting. |
It could just be my setup. |
Hello,
I've written a couple of features for a project I'm working on and I've ran into situations where I'm not sure what the best approach to take is.
For example, I have a feature which involves installing a CLI tool using
npm
. Now, I'm not sure whether this feature should also install Node.js so that it is able to install the CLI tool, since I have no control over the base image, nor the included features in thedevcontainer.json
file.The power of features, as I understand, is that they can be composed together; making each serve one purpose (installing the given feature) thus providing a simple way to handle all the tooling permutations for many different developers and/or teams whilst avoiding "golden container images"; and similar perhaps in concept to buildpacks.
So it occurred to me that since
devcontainers/features
already provide features for installing Node.js (and other language runtimes), it would be beneficial to make my feature dependant on thenode
feature. Then I wouldn't need to worry about which base image a developer is using, and thenode
feature would be automatically included before mine, so my feature would install reliably.Additional scenarios include:
build-essential
to be installed.pip
, needing to ensure Python and pip are installed.go install
, needinggo
to be installed.tflint
ruleset for AWS, which requires Terraform andtflint
to be installed.I realise installing packages using a
postCreateCommand
script can work, but it places the onus on the developer to know what features to include to install the given package. For example, I'm building features which install Python packages (e.g.mkdocs
) for C# .Net developers, who wouldn't know to include thepython
feature.I imagine a
devcontainer-feature.json
file including adependsOn
property, in the same schema as thedevcontainer.json
features
object.I.e.
The text was updated successfully, but these errors were encountered: