-
Notifications
You must be signed in to change notification settings - Fork 20
116 lines (101 loc) · 3.7 KB
/
CI-full.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CI-application-containers
on:
workflow_dispatch:
release:
types: [published]
env:
python-version: "3.10"
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get the VCell version from tags
id: version
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
- name: set global environment variables
run: |
echo "VCELL_TAG=`git rev-parse --short HEAD`" >> $GITHUB_ENV
echo "VCELL_REPO_NAMESPACE=ghcr.io/virtualcell" >> $GITHUB_ENV
echo "VCELL_DEPLOY_REMOTE_DIR=/share/apps/vcell3/deployed_github" >> $GITHUB_ENV
echo "VCELL_MANAGER_NODE=vcellapi-beta.cam.uchc.edu" >> $GITHUB_ENV
- name: setup ssh-agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.VC_KEY }}
- name: get installer secrets
run: |
ssh-keyscan vcellapi-beta.cam.uchc.edu >> ~/.ssh/known_hosts
sudo mkdir /usr/local/deploy
sudo chmod 777 /usr/local/deploy
cd /usr/local/deploy
scp ${{ secrets.CD_FULL_USER }}@${VCELL_MANAGER_NODE}:${VCELL_DEPLOY_REMOTE_DIR}/deploy_dir_2023_07_30.tar .
cd ..
sudo tar -xvf deploy/deploy_dir_2023_07_30.tar
sudo chmod 777 -R deploy
- 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
poetry run python -m pytest
- name: build vcell-admin package
run: |
cd docker/swarm/vcell-admin
poetry install
poetry run python -m pytest
- name: build pythonCopasiOpt package
run: |
cd pythonCopasiOpt/vcell-opt
poetry install
poetry run python -m pytest
- name: build pythonVtk package
run: |
cd pythonVtk
poetry install
poetry run python -m pytest
- name: build vcutils package
run: |
cd python-utils
poetry install
poetry run python -m pytest
- name: build python-restclient package
run: |
cd python-restclient
poetry install
poetry run python -m pytest
- name: build vcelldata package
run: |
cd pythonData
poetry install
poetry run python -m pytest
- name: setup java 17 with maven cache
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: build and publish all images
shell: bash
run: |
cd docker/build
echo "${{ secrets.GITHUB_TOKEN }}" | sudo docker login ghcr.io -u ${{ github.actor }} --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
./build.sh all ${{ env.VCELL_REPO_NAMESPACE }} ${{ env.VCELL_TAG }}
- name: tag as latest and push to registry
shell: bash
run: |
for CONTAINER in vcell-api vcell-rest vcell-webapp-prod vcell-webapp-dev vcell-webapp-stage vcell-webapp-island vcell-batch vcell-opt vcell-clientgen vcell-data vcell-db vcell-mongo vcell-sched vcell-submit vcell-admin;\
do docker tag ${VCELL_REPO_NAMESPACE}/$CONTAINER:${VCELL_TAG} ${VCELL_REPO_NAMESPACE}/$CONTAINER:latest;\
docker tag ${VCELL_REPO_NAMESPACE}/$CONTAINER:${VCELL_TAG} ${VCELL_REPO_NAMESPACE}/$CONTAINER:${{ steps.version.outputs.tag }};\
docker push --all-tags ${VCELL_REPO_NAMESPACE}/$CONTAINER;\
done
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ failure() }}