Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Build BATS Docker image locally #143

Merged
merged 10 commits into from
Jun 12, 2024
Merged

Conversation

CasperWA
Copy link
Member

@CasperWA CasperWA commented Jun 12, 2024

Fixes #142
Fixes #123

By git cloning the bats-core repository locally and building the Dockerfile with the build argument bashver to point to a specific bash Docker image tag, it is possible to use a specific alpine version, which in turn let's us use a specific Python version.

We want to use the latest possible alpine version that uses Python 3.9 (as this is currently the minimum supported version for OPTIMADE Python tools). This alpine version is 3.15 (see the packages overview for confirmation, searching for python3, changing the branch accordingly).

Another, future, solution here, would be to build the custom BATS Docker image "once" and upload it to the GitHub container repository and use it there. I suggest doing this in another PR, however, for now. An issue should be opened for this around the merge-time of this PR.

Finally, as a bonus, the set-output usage has been replaced with redirecting to the GITHUB_OUTPUT environment variable (if the GITHUB_ACTIONS environment variable is true, as it will always be when running in GitHub Actions).

Note, this also ignores the safety ID related to jinja2, see GHSA-f6pv-j8mr-w6rr for more information.

Use virtualenv to install optimade into, removing the virtualenv at the
end.

Tried using pipx first, but this did not function as intended - so I
defaulted to virtualenv.

Updating the base of the Dockerfile to be a materials-consortia-specific
bats image, which is to be created manually prior to building the
Dockerfile image. Information about this must be added to the README.
First, build a custom BATS image using alpine3.15, as this alpine
version is the latest to use Python 3.9.
Use setup_suite.bash to only create the entrypoint.sh copy once, instead
of once for every file.

Reset all defaults now also for each new test, instead of for each file
run.
@CasperWA CasperWA requested a review from ml-evs June 12, 2024 10:05
@CasperWA CasperWA merged commit 2dbea81 into master Jun 12, 2024
9 checks passed
@CasperWA CasperWA deleted the cwa/fix-142-bats-docker-image branch June 12, 2024 14:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with BATS docker image Update usage of set-output GH Actions command
1 participant