-
Notifications
You must be signed in to change notification settings - Fork 24
75 lines (63 loc) · 2.69 KB
/
staging.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
name: staging-model
on:
push:
branches:
- 'staging*'
env:
nexus_server: 10.128.81.69:8082
cicd_path: /var/data/cicd/CICD_github_assets/
model_id: 20230930_60k_basic_targetted_epoch37_Myria3DV3.4.0
jobs:
staging-model:
runs-on: self-hosted
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Build docker image
run: docker build -t myria3d .
- name: Inference on validation set of 20211001_building_val-lidar-prod-optimization
run: >
docker run
-v ${cicd_path}:/cicd/
--ipc=host
--shm-size=2gb
myria3d
python run.py
task.task_name=predict
predict.src_las=/cicd/20211001_building_val-lidar-prod-optimization/val/*.las
predict.output_dir=/cicd/lidar_prod_optimization/${model_id}/preds-valset/
predict.interpolator.probas_to_save=[building]
- name: Inference on validation set of 20211001_building_val-lidar-prod-optimization
run: >
docker run
-v ${cicd_path}:/cicd/
--ipc=host
--shm-size=2gb
myria3d
python run.py
task.task_name=predict
predict.src_las=/cicd/20211001_building_val-lidar-prod-optimization/test/*.las
predict.output_dir=/cicd/lidar_prod_optimization/${model_id}/preds-testset/
predict.interpolator.probas_to_save=[building]
# NB: we run the new, tagged image at least once so that is it not prunned
# by mistake when using docker system prune.
- name: Tag the docker image with branch name
run: |
docker tag myria3d:latest myria3d:${{github.ref_name}}
docker run myria3d:${{github.ref_name}} bash
# get version number and date, to tag the image pushed to nexus
- name: get version number
id: tag
run: |
echo "::set-output name=version::$(docker run myria3d grep '__version__' package_metadata.yaml| cut -d\" -f2)"
echo "::set-output name=date::$(date '+%Y.%m.%d')"
- name: push branch docker on nexus (tagged with the branch name)
# we push on nexus an image from a branch when it's pushed
if: ((github.event_name == 'push') && (github.ref_name != 'main'))
run: |
docker tag myria3d $nexus_server/lidar_hd/myria3d:${{steps.tag.outputs.version}}-${{github.ref_name}}
docker login $nexus_server --username svc_lidarhd --password ${{ secrets.PASSWORD_SVC_LIDARHD }}
docker push $nexus_server/lidar_hd/myria3d:${{steps.tag.outputs.version}}-${{github.ref_name}}
- name: Clean dangling docker images
if: always() # always do it, even if something failed
run: docker system prune --force # remove dangling docker images, without asking user for confirmation