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

Explicit lifecyle command ordering. #367

Open
Clockwork-Muse opened this issue Jan 2, 2024 · 2 comments
Open

Explicit lifecyle command ordering. #367

Clockwork-Muse opened this issue Jan 2, 2024 · 2 comments

Comments

@Clockwork-Muse
Copy link

I'm currently working around some of the issues with the python feature on bookworm, which ends up involving using pipx to install some packages. That's fine.

The problem I'm experiencing is that commands can and are run in parallel, I have multiple packages to install, and pipx is (rightfully) rejecting concurrent modifications to parts of the environment it manages.

Obviously, there are multiple workarounds;

  • Writing a single shell script to call all the relevant commands
  • Concatinating everything together with && or similar.

Both are less than desirable;

  • With a shell script, it hides the commands with another level of indirection.
  • Concatinating everything together can result in some really long or otherwise hard to parse lines.

So what I'd like is some way to have some way to designate some lifecycle commands as at least mutually exclusive in a "group", or better completely ordered.

@eljog
Copy link
Member

eljog commented Jan 6, 2024

Thank you for creating this issue and sharing suggestions.

To be able to understand this better, could you please share the details of the error messages/stack traces, and the steps to reproduce the problem?

@Clockwork-Muse
Copy link
Author

Given the following minimal devcontainer.json definition:

{
	"name": "Something",
	"image": "mcr.microsoft.com/devcontainers/base:1-bookworm",
	"runArgs": [
		// Required to run on Podman, remove to run on Docker
		// "--userns", "keep-id",
	],
	"features": {
		"ghcr.io/devcontainers-contrib/features/apt-packages": {
			"packages": "python3-pip,pipx"
		}
	},
	"containerEnv": {
		"HOME": "/home/vscode",
	},
	"postCreateCommand": {
		"commitizen": "pipx install Commitizen",
		"iotedgedev": "pipx install iotedgedev",
	}
}

.... I had thought that there were potentially errors resulting from some conflict with concurrent pipx commands, but I may have been misreading some unrelated errors.

That said, the commands are run concurrently, which may or may not cause problems in some cases:

[24339 ms] Start: Run in container: /bin/sh -c pipx install Commitizen
[24339 ms] Start: Run in container: /bin/sh -c pipx install iotedgedev

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

2 participants