-
Notifications
You must be signed in to change notification settings - Fork 20
86 lines (76 loc) · 2.91 KB
/
create_bs_singularity.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Create biosim containers
on:
workflow_dispatch:
inputs:
commit_sha:
description: 'commit ID'
required: true
default: 3ca1093da599a0ff4229b1130efe7a3924ff2b4c
env:
python-version: "3.10"
jobs:
CD:
name: CD
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
cache: "pip"
- name: Install Dependencies
run: pip install -r requirements.txt
- name: build vcell-cli-utils package
run: |
cd vcell-cli-utils
poetry install
- name: build vcell-admin package
run: |
cd docker/swarm/vcell-admin
poetry install
- name: setup java 17 with maven cache
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Add Linux dependencies
shell: bash
run: |
mvn -version
java -version
mvn --batch-mode clean install dependency:copy-dependencies -DskipTests=true
- name: set global environment variables
run: |
echo "VCELL_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV
- name: Install Singularity # to make singularity image to use on cluster
uses: eWaterCycle/setup-singularity@v6
with:
singularity-version: 3.8.3
- name: Build Docker image and push with latest tag
run: |
set -ux
REVISION=$(git rev-parse HEAD)
CREATED=$(date --rfc-3339=seconds | sed 's/ /T/')
sed -i 's/_VC_VERSION_TAG_/${VCELL_SHA}/g' biosimulators.json
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker build \
--no-cache \
--file Dockerfile \
--build-arg SIMULATOR_VERSION=${VCELL_SHA} \
--tag ghcr.io/virtualcell/biosimulators_vcell:${VCELL_SHA} \
--label org.opencontainers.image.revision=${REVISION} \
--label org.opencontainers.image.created=${CREATED} \
--label org.opencontainers.image.version=${VCELL_SHA} \
--label org.opencontainers.image.license=MIT \
.
docker push --all-tags ghcr.io/virtualcell/biosimulators_vcell
singularity build biosimulators_vcell_${VCELL_SHA}.img docker:ghcr.io/virtualcell/biosimulators_vcell:${VCELL_SHA}
singularity remote login -u "${{ secrets.GITHUB_TOKEN }}" -p ${{ github.actor }} oras://ghcr.io
singularity push -U biosimulators_vcell_${VCELL_SHA}.img oras://ghcr.io/virtualcell/biosimulators_vcell_singularity:${VCELL_SHA}
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}