Skip to content

Commit

Permalink
Merge pull request #3 from biosimulators/main
Browse files Browse the repository at this point in the history
feat: merge second version changes
  • Loading branch information
AlexPatrie authored Feb 22, 2024
2 parents 16fff29 + 5cf1c1c commit 7d6e59c
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ __pycache__
submit-biosimulators-container.sh
.vagrant
._vagrant
.THIS-IS-FOR-CONTAINER-DEV-ONLY
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ There are two primary methods of interaction with `biosimulator-processes`:

3. Run the image, ensuring that the running of the container is platform-agnostic:

docker run --platform linux/amd64 -it -p 8888:8888 ghcr.io/biosimulators/biosimulator-processes:latest
docker run --platform linux/amd64 -it -p 8888:8888 ghcr.io/biosimulators/biosimulator-processes:latest

As an alternative, there is a helper script that does this and more. To use this script:

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cobra = "*"
tellurium = "*"
smoldyn = "*"
bigraph-viz = "^0.0.31"
python-libsbml = "^5.20.2"

[tool.poetry.group.dev.dependencies]
pytest = "*"
Expand Down
16 changes: 16 additions & 0 deletions scripts/build-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

version="$1"

set -e

if [ "${version}" == "" ]; then
echo "Please enter the version you would like to build as a runtime arg. Exiting."
exit 1
fi

yes | docker system prune
docker buildx create --name biosimbuilder --use
docker buildx inspect --bootstrap
docker buildx build --platform linux/amd64 \
-t ghcr.io/biosimulators/biosimulator-processes:"${version}" .
34 changes: 34 additions & 0 deletions scripts/docker-pipeline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash


version="$1"

run="$2"

if [ "${version}" == "" ]; then
echo "You must pass the container version you wish to run as an argument to this script. Exiting."
exit 1
fi


if [ "${version}" == "${current}" ]; then
echo "This version already exists on GHCR. Exiting."
exit 1
fi

echo "Enter your Github User-Name: "
read -r usr_name

if docker login ghcr.io -u "${usr_name}"; then
echo "Successfully logged in to GHCR!"
else
echo "Could not validate credentials."
exit 1
fi

./scripts/build-container.sh "${version}" \
&& ./scripts/release-container.sh "${version}" \

if [ "${run}" == "-r" ]; then
./scripts/run-container.sh "${version}"
fi
38 changes: 38 additions & 0 deletions scripts/release-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash


version="$1"

# PLEASE UPDATE THE LATEST VERSION HERE BEFORE RUNNING. CURRENT: 0.0.2
current="0.0.2"

set -e

if [ "${version}" == "" ]; then
echo "You must pass the container version you wish to release as an argument to this script. Exiting."
exit 1
fi

if [ "${version}" == "${current}" ]; then
echo "This version already exists on GHCR. Exiting."
exit 1
fi

echo "Enter your Github User-Name: "
read -r usr_name

if docker login ghcr.io -u "${usr_name}"; then
echo "Successfully logged in to GHCR!"
else
echo "Could not validate credentials."
exit 1
fi

yes | docker system prune
docker buildx create --name biosimbuilder --use
docker buildx inspect --bootstrap
docker buildx build --platform linux/amd64 \
-t ghcr.io/biosimulators/biosimulator-processes:"${version}" . \
--push
docker tag ghcr.io/biosimulators/biosimulator-processes:"${version}" ghcr.io/biosimulators/biosimulator-processes:latest
docker push ghcr.io/biosimulators/biosimulator-processes:latest
10 changes: 10 additions & 0 deletions scripts/run-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

version="$1"

if [ "${version}" == "" ]; then
echo "Please enter the version you would like to run as a runtime arg. Exiting."
exit 1
fi

docker run --platform linux/amd64 -it -p 8888:8888 ghcr.io/biosimulators/biosimulator-processes:"${version}"
36 changes: 0 additions & 36 deletions scripts/run-docker.sh

This file was deleted.

0 comments on commit 7d6e59c

Please sign in to comment.