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

Unittest images #36

Closed
wants to merge 30 commits into from
Closed

Unittest images #36

wants to merge 30 commits into from

Conversation

johnbradley
Copy link
Contributor

Runs unit tests on images to make sure they will work with both docker and singularity.
test.py look for files named unitest.yml. These files are assumed to be in a directory with a Dockerfile. The unittest.yml file will contain a list of commands to run that contain a cmd and expected_output regex pattern.

TODO

  • cleanup hard coded values
  • setup integration tests

Looks through all directories for unittest.yml files.
It assumes there is a Dockerfile in the directory with this file.
It guesses a name for the image.
Builds the Dockerfile tagging that name using docker.
For each command, expected_output pair in the unittest.yml file:
   run the image passing the command
   compares the expected_output(regex) against the output from the image
   exits if any images failed

WIP
Approach taken from apptainer/singularity#429 (comment)
1. Creates docker container using local image.
2. Create singularity image
3. export docker image | import new singularity image
Other methods didn't fully setup singularity environment.
singularity was unable to reach the image registry
Adding docker registry image to the circle config.

Currently using circleci `docker` machine type.
The `machine` machine type might resolve this issue but
> Use of machine may require additional fees in a future pricing update.

https://circleci.com/docs/2.0/executor-types/
this is to work around a cached venv from docker executor type
that doesn't work under machine exexutor type
Also fixes picard unittest
singularity didn't like "trimmomatic:0.32+dfsg-1"
on dockerhub its trimmomatic:0.32_dfsg-1
creates tests directory to hold image testing framework
renames test.py to imagecheck
Adds more print commands so it is easier to see progress in the tests
This resulted in occasional connection reset by peer errors when
running `docker push`.
@johnbradley
Copy link
Contributor Author

Closing this for now due to the complexity and time it takes to run.
It takes over 30 minutes to run the tests and is really testing the docker to singularity changes that are not part of this repository. We have so far only identified two general issues with converting docker to singularity:

Both issues can be seen using just docker via the --workdir and --user options.

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

Successfully merging this pull request may close these issues.

1 participant