Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Fix prod and dev container after recent updates to pyproject.toml #49

Closed
wants to merge 4 commits into from

Conversation

GernotMaier
Copy link
Contributor

@GernotMaier GernotMaier commented Aug 11, 2023

The recent updates to pyproject.toml unfortunately broke both dev and prod containers:

Prod:

The setting of the simtools version using setuptools-scm requires a full git clone (and not a simple wget of the zip file from github).

This requires also the installation of git which increase the size of the container by a very small amount.

Dev:

pip install '.[tests,dev,doc]' is not working anymore without the simtools code available. I see three options to solve this and I've decided the last one is the simplest:

  • heavily use sed and grep to modify the pyproject.toml file (but any change to the file would require to adapt those sed/grep commands)
  • move back to use mamba or conda
  • use the tiny ptoml-to-requirements](https://pypi.org/project/toml-to-requirements/) package to export the dependencies to a requirements.txt file and use this in pip install -r requirements.txt.

@GernotMaier GernotMaier self-assigned this Aug 11, 2023
@GernotMaier GernotMaier changed the title Using setuptools-scm in simtools require foll git clone Using setuptools-scm in simtools require full git clone Aug 11, 2023
@GernotMaier GernotMaier changed the title Using setuptools-scm in simtools require full git clone Fix prod and dev container after recent updates to pyproject.toml Aug 11, 2023
@GernotMaier GernotMaier marked this pull request as ready for review August 11, 2023 09:34
@VictorBarbosaMartins
Copy link
Contributor

Hi @GernotMaier. I have realized that building this container works fine but running it leads to an error which finishes with:

          raise OSError("%r was not found" % name)
      OSError: 'git' was not found
      [end of output]

The bottom line is that the pip install -e . command needs git installed. Orel and I tested locally and with git installed everything works fine again. Could you please also add the git installation before pip install -e .? Thanks.

@GernotMaier
Copy link
Contributor Author

I hope you didn't spend a lot of time on this - this should be solve in gammasim/simtools#532 (at least those images work for me).

I should have noted it there, to review first that one, and then we fix it here for completeness but archive the container repository.

@GernotMaier
Copy link
Contributor Author

I've propagated the changes from gammasim/simtools#532 into this repository and tested the simtools-dev container (the issue was the missing git installation).

@VictorBarbosaMartins - can you have another look? This PR is really only to archive a working repository.

@VictorBarbosaMartins
Copy link
Contributor

Hi @GernotMaier , sorry for the long wait. There is a test failing here and I also see that the docker file is not the same as the one in the simtools/docker directory. I suggest we copy over the code from there, which is the most up to date implementation, and in case all the tests pass here, we merge it and archive the repository. What do you think?

@GernotMaier
Copy link
Contributor Author

The container archive is not relevant anymore (docker-related items have been moved to https://github.com/gammasim/simtools/tree/main/docker)

Therefore closing this PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants