-
-
Notifications
You must be signed in to change notification settings - Fork 17
Adding spec version 2.0 #41
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
Conversation
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
This commit also requires singularity python 0.1.0 or greater, which adds support for better instance listing by way of parsing --json. The reason to bump up is that this json flag is only supported for 3.5.2 and up. Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
the reason is that we need to support older version of singularity with instance list --json not having all the fields Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
docs/spec/spec-2.0.md
Outdated
| # Singularity Compose Version 2.0 | ||
|
|
||
| The second version of the singularity compose spec has added options for | ||
| starting an instance, and exec'ing commands after that. Note that spec v2.0 is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
starting, exec'ing, and running
| if circular_dep: | ||
| bot.exit("Unable to create all instances, possible circular dependency.") | ||
|
|
||
| # Build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'for loop' above prevents some containers from running. Any container that runs indefinitely will block execution of this loop and prevent all subsequent containers from running. Many web service containers operate this way.
I tried to pass command args like "indefinite.sh arg1 >& stdout.txt &" but I get errors related to invalid command args. Unless there's another existing method for backgrounding an indefinite execution script I'm not aware of, this loop ought to provide a new method to allow for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs to be addressed separately, it's not in scope for the PR here. It totally depends on the command that you provide - for most of the use cases I've seen they just are creating the instance without something that would continue running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this PR is merged, we won't release, but you can open another issue with an example to reproduce and we can work on separately. The scope of this PR is already too big.
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
|
everything i've tested from these comments appears to be working now. the only exception is for the backgrounding issue, which I agree belongs in another issue |
|
Great! Shall we merge here and then work on that? |
|
@vsoch yes, that would be great! |
|
Hi, I'm trying to start the following postgres service below, but am running into issues with the port configuration:
instances: The interactive environment I have is started with fakeroot (and --writable), so I am "root" while trying to run "singularity-compose up":
Is there something you can suggest to get around this? |
|
Your recipe is hard to read because it's not formatted, but I'm wondering what the purpose of the "networks" block is? Same with restart. But generally if there is a message that there is no instance named postgres, it's likely that there is some issue creating the instance. Try running with |
|
Hi, sorry about that. The networks and restart were pulled from a docker-compose file I was trying to convert over. Hopefully this is better: The issue I am having is that I am already "root" (started the interactive session with fakeroot), but the error message above is stating that I need root or fakeroot. This only happens when I include the ports section. |
|
As I mentioned, you should try with singularity-compose --debug up -d |
|
if you want to use fakeroot, you need to add it as an option -> https://github.com/singularityhub/singularity-compose-examples/blob/ad394dffe92ddf70d792cfdd3f63ad8383a24713/v1.0/jupyter-simple/singularity-compose.yml#L7 |
|
I don't think Singularity knows that you are fakeroot, you have to tell it explicitly. If that doesn't work with fakeroot, you might start your interactive session without and use the flag. And if you are running this from inside another container (e.g., Docker) you likely will run into other issues. I'm still not sure singularity runs well (or at all) inside docker for most things. |
|
The output of --debug after adding the fakeroot: I suppose this is an issue since I am already "root" via fakeroot (this environment is started with singularity run -f), and adding the fakeroot to the start.options won't really help. I have this encapsulated environment so users have their own space to develop containers in, which enables them as fakeroot in this interactive session. |
|
Okay so this is your command: singularity instance start --bind /tmp/postgresql-data:/var/lib/postgresql/data --bind /tmp/resolv.conf:/etc/resolv.conf --bind /tmp/etc.hosts:/etc/hosts --net --network-args "portmap=5432:5432/tcp" --network-args "IP=10.22.0.2" --hostname postgres --writable-tmpfs /tmp/postgres/postgres.sif postgrestry that in the terminal directly, if you get the message about fakeroot, first try adding the flag, if that doesn't work, restart your session without fakeroot and then add it. |
|
I don't think you can run singularity inside of singularity. |
|
singularity-compose needs to be run on your host where singularity is installed, and not in a container that happens to have singularity. |
|
Ok, thanks |
This PR will add support for a spec 2.0, which we are version bumping because we have added support for exec and start groups, and moved the previous command (on the level of the instance) to be within start. I've also written up a "ping" example: https://github.com/singularityhub/singularity-compose-examples/pull/4/files#diff-70a0c5dcf3d1984dde44c1e48e3ceee2338fe47624fd784565ece7375adcd21f that can be used to test. There are more extensive changes because I also updated black and the docs.