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

spython incorrectly fills in ARGs #187

Closed
richelbilderbeek opened this issue Feb 11, 2022 · 6 comments
Closed

spython incorrectly fills in ARGs #187

richelbilderbeek opened this issue Feb 11, 2022 · 6 comments

Comments

@richelbilderbeek
Copy link

First: thanks for spython, it is a great tool to use tested Dockerfiles as another source of working Singularity files!

Here, however, I think I found a lil' bug. I did my best to make it easy to understand and reproduce and hope I did a good job! Thanks for being awesome and cheers, Richel

Expected Behavior

When I use spython to convert a Docker file, I expect the ARGs to be substituted correctly.

For example, when the Docker file starts with (full Docker file below) ...

ARG CUDA_VERSION=11.1.1
ARG OS_VERSION=20.04
FROM nvidia/cuda:${CUDA_VERSION}-cudnn8-devel-ubuntu${OS_VERSION}

... I expect that calling spython to create a Singularity file ...

spython recipe Dockerfile &> Singularity

to start with:

Bootstrap: docker
From: nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04

Actual Behavior

However, the top line becomes:

Bootstrap: docker
From: nvidia/cuda:11.1.1-cudnn8-devel-ubuntu11.1.1

It seems that the first argument (CUDA_VERSION) is pasted twice, instead of having on CUDA_VERSION paste and one OS_VERSION paste.

Steps to Reproduce

Unzip this:

spython_issue.zip

spython recipe Dockerfile &> Singularity

It will create a file, Singularity that is the same as the file Singularity_incorrect.
Spython should create a file that is the same as the file Singularity_expected.

Context

  • Operating System: Ubuntu 20.04
  • singularity version: singularity --version: singularity version 423bcf8-dirty
  • spython version: spython --version: 0.1.18
  • python version: python --version: Python 2.7.18, python3 --version: Python 3.8.10

Failure Logs

N/A

Possible Fix

No idea, need to see where the ARGs are inserted :-)

richelbilderbeek pushed a commit to richelbilderbeek/GenoCAE that referenced this issue Feb 11, 2022
@vsoch
Copy link
Member

vsoch commented Feb 11, 2022

This looks to be a bug! Unless you beat me to it, I'll try to debug this weekend. Thanks!

@vsoch
Copy link
Member

vsoch commented Feb 11, 2022

hey @richelbilderbeek ! This turned out to be a quick fix - there was a regex that was a little too heavy handed. Here is a PR to test: #188 and I've added your case as a new test.

I'm going back so sleep but should be back after that! 😆

@vsoch
Copy link
Member

vsoch commented Mar 28, 2022

ping @richelbilderbeek did you ever get to test this?

@richelbilderbeek
Copy link
Author

@vsoch IIRC yes, it worked! Sorry I forgot to mention that and thank you for that; I appreciate your cool work quite a bit and I usually do that; something must have made me slip my mind there!

@vsoch
Copy link
Member

vsoch commented Mar 29, 2022

ah ok! The PR is old enough that it cannot easily be merged so I'll need to make it over again, reopening issue until we have another one to test.

@vsoch vsoch reopened this Mar 29, 2022
vsoch added a commit that referenced this issue Mar 29, 2022
Signed-off-by: vsoch <vsochat@stanford.edu>
@vsoch vsoch closed this as completed in 0433d28 Mar 29, 2022
@richelbilderbeek
Copy link
Author

@vsoch you are awesome!

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 a pull request may close this issue.

2 participants