-
Notifications
You must be signed in to change notification settings - Fork 45
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
Singularity Image Support #125
Conversation
Hi @wagoodman, just checking in to see if there's anything I can do to push this forward. Thanks! |
Hey @tri-adam thank you for working on this feature, I ran CI validations and there are issues with licenses from these dependencies:
|
@tri-adam we're going to review these new licenses internally to ensure we can pull in these dependencies safely (from a legal perspective), I'll report back soon |
@jonasagx @wagoodman thanks. It looks like both of those are pulled in by github.com/CalebQ42/squashfs:
Let me know the results of the legal review, thanks. |
Hey @tri-adam , sorry to report that GPL-2.0 licensed dependencies cannot be introduced into the codebase at this time (CC0-1.0 is ok to introduce though). Is seems that the LZO license is not something that could be controlled by the repo owner too:
There are a couple of paths forward:
Thanks for bearing with us on this 🙏 |
LZO support requires the github.com/rasky/go-lzo module, which is GPLv2 licensed and thus not suitable for inclusion in some projects (see discussion in anchore/stereoscope#125).
LZO support requires the github.com/rasky/go-lzo module, which is GPLv2 licensed and thus not suitable for inclusion in some projects (see discussion in anchore/stereoscope#125). Signed-off-by: Adam Hughes <[email protected]>
Took a stab at option 3, removing LZO support from the underlying module, and it's reasonably easy (CalebQ42/squashfs@v0.5.4...sylabs:remove-lzo-v0.5.4). SingularityCE does not appear to rely on LZO compression, so I don't foresee any negative impacts in terms of functionality. Still some further testing to do, but it's a start! |
great news! |
pkg/image/source.go
Outdated
@@ -76,6 +79,8 @@ func ParseSourceScheme(source string) Source { | |||
return OciTarballSource | |||
case "oci-registry", "registry": | |||
return OciRegistrySource | |||
case "singularity-image": |
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.
I think we could use a shorter name here such as singularity
or sif
(and "image" is redundant here) -- what do you think @tri-adam ?
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.
I went ahead and shorted it to singularity
, however, I'll hold off on pulling the trigger on merging until I hear back from you on this particular change
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.
sif
would likely be my suggestion - as that's what has been adopted by support brought into containers/image
and hence podman
which are using sif
as the 'transport' name.
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.
FYI -- force pushed to resolve merge conflict in go.mod/go.sum
@tri-adam right now integration tests are failing due to lack of image types covered (since singularity was added). The next step is to add testing that covers:
I think the one thing I'm hung up on is that these tests depend on building the same image and obtaining it in different ways -- is there a way to nicely achieve that in testing with singularity images? If not, that's ok, we can make one off tests to assert this functionality (in integration or unit-level testing). Shout out if there is anything I can do to clarify or help! |
Hi @wagoodman. Thanks for the review and comments on this! I work with @tri-adam at Sylabs and might be picking this work up from him for a short time. I'll look into the tests in detail as soon as possible. With regard to building a SIF, within the workflow, that would be possible from the docker image that is generated here with an install of Singularity. We do package SingularityCE ourselves for Ubuntu, with those packages hosted on GitHub releases ... but I'm not sure whether you'd want to add an install into the CI workflows? A final thought is that we could get close enough to a 'real' Singularity built SIF by directly leveraging |
hey @dtrudg 👋
I'm ok with either approach, my only hesitation with option The goal of any approach is to make certain that the content API of stereoscope functions with the new image type in a realistic setting (querying files by a glob or path, getting file contents, resolving symlinks properly, etc). What's the approach that you suggest / lean towards? |
Thanks @wagoodman - I can work it up with (a) and if the impact is too high we can switch to (b). It would be nicer to actually build the container with 'real' Singularity, than construct it. ourselves. Hopefully I'll have time to put something together for this during the week here. |
Hi @wagoodman - I've taken a go at fitting some testing for singularity SIFs in with the existing image_simple / image_symlinks. Would be grateful for any feedback on whether this approach looks acceptable, and worth tidying up further, or we should go for separate tests. Many thanks for your patience! |
I'm sorry for the test failure due to the apt install... that was a 🤦 |
Signed-off-by: Dmitry Harkavyi <[email protected]>
Use github.com/CalebQ42/squashfs module to read the contents of Singularity Image Format (SIF) container images without mounting them. Expose Singularity Images via GetImageFromSource rather than adding a SIF-specific GetSifImageFromSource by providing a GGCR v1.Image implementation backed by a SIF. This avoids the requirement of separate code paths within consumers of stereoscope such as syft. Signed-off-by: Adam Hughes <[email protected]>
Switch to fork of github.com/CalebQ42/squashfs, which removes the GPLv2-licensed indirect github.com/rasky/go-lzo dependency. Signed-off-by: Adam Hughes <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Signed-off-by: Alex Goodman <[email protected]>
Modify the TestSimpleImage and TestImageSymlinks code to incorporate testing of a singularity sif image source. This requires signficant adaptations as singularity squashes containers down to a single layer. Singularity is expected to be available, and is is now installed in the ci-bootstrap Makefile target (from a GitHub release). Signed-off-by: David Trudgian <[email protected]>
Hi - I've re-based again onto the latest main. Looks like the last CI run prior to the rebase did pass, so would be grateful for any feedback on the testing approach, and what cleanup might be needed here. Many thanks! |
sorry for the delay @dtrudg , approved the workflow and are reviewing the changes now. |
Signed-off-by: Alex Goodman <[email protected]>
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.
Many thanks @wagoodman - I'll take a look at the related syft PR next. Thanks for your help, and apologies this was pretty slow from our side. |
@dtrudg no need to apologize, this slid on my side as well 👍 I'm looking at anchore/syft#974 and just pulled in the latest stereoscope and |
@dtrudg I updated anchore/syft#974 and it seems to be working great -- did you want to add anything or give it a shot before merging? |
@wagoodman I'll take a quick check within the next couple of hours when I'm out of a couple of calls, and ping you over on that PR if that's okay? I think it should be good but don't want to overlook anything given I'm picking it up from tri-adam :-) |
This PR is based on the work in #123, and is proposed as a potential way forward based on the feedback there and the discussion in the last community call. @Poluect has unfortunately had to step away from the Sylabs team on short notice, so I'm picking up where he left off.
This PR uses github.com/CalebQ42/squashfs to read the root filesystem contents. This is a pure Go library, and doesn't require a
mount
.Structurally, this PR takes a different approach than #123, exposing Singularity Images via the existing
func GetImageFromSource
rather than adding a SIF-specificfunc GetSifImageFromSource
. This adds a bit more complexity instereoscope
, but keeps the exported API tighter and makes it a lot easier to support SIF in projects consuming this module such assyft
(I'll open a PR there shortly that uses pulls in this work.)Related to anchore/syft#937, sylabs/sif#190