forked from sandialabs/firewheel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
138 lines (130 loc) · 3.8 KB
/
.gitlab-ci.yml
File metadata and controls
138 lines (130 loc) · 3.8 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
###############################
# FIREWHEEL's Continuous Integration
#
# This GitLab CI file enables testing of FIREWHEEL
# on a variety of operating systems and versions of
# Python.
#
###############################
include:
- local: .gitlab/ci/setup.yml
###############################
# Creating a few defaults and setting up the Pipeline stages.
###############################
default:
tags:
- vm
stages:
- lint
- test
- deploy
###############################
# Performance Testings
#
# These anchors create an environment for running a stress-test for FIREWHEEL's
# performance.
#
###############################
performance-ubuntu2204:
stage: test
tags:
- $CI_PERFORMANCE_RUNNER
needs: []
variables:
BASE_PYTHON: python3.10
before_script:
- !reference [.create_venv, before_script]
- !reference [.install_firewheel, before_script]
- !reference [.configure_firewheel, before_script]
- !reference [.install_mcs, before_script]
- !reference [.provision_mcs, before_script]
script:
- pushd /opt/firewheel
# Enable FW to cache images
- firewheel experiment --no-install tests.vm_gen:1 minimega.schedules_ready
# Create a network with a lot of vertices and edges
- firewheel experiment --no-install --profile tests.vm_gen:10000 tests.connect_all:10 minimega.schedules_ready
- python -m pip install $PIP_ARGS snakeviz
- wget https://gist.githubusercontent.com/MSSandroid/6402e2e99e31633386a312b283839e0d/raw/4890a4ac54c3dae72a634da92f84c2adc7480056/snakeviz_static_html.py -O snakeviz_static_html.py
- python snakeviz_static_html.py firewheel_profile.prof
- mv firewheel_profile.html $HOME/$CI_PROJECT_DIR/profile
- popd
artifacts:
paths:
- profile
rules:
- if: $FIREWHEEL_TEST_PERFORMANCE == "true"
###############################
# Create Documentation
###############################
docs:
image: $DOCKER_REGISTRY/python:3.11
stage: lint
tags:
- $CI_DOCKER_RUNNER
needs: []
before_script:
- !reference [.create_venv, before_script]
- !reference [.install_firewheel_package, before_script]
- !reference [.configure_firewheel_docker, before_script]
- !reference [.install_mcs, before_script]
script:
- tox -e dependencies,docs
- mkdir documentation
- mv docs/build/html documentation/html
artifacts:
expire_in: 3 mos
paths:
- documentation
name: "${CI_PROJECT_NAME}_${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
rules:
- if: $CI_COMMIT_BRANCH =~ /^documentation.*$/
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
pages:
image: $DOCKER_REGISTRY/python:3.11
stage: deploy
tags:
- $CI_DOCKER_RUNNER
needs:
- job: docs
artifacts: true
before_script:
- echo "Starting pages."
script:
- mv documentation/html public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
###############################
# Build and Deploy
#
# Build FIREWHEEL as a Python package and
# deploy it to a local package registry
#
###############################
build:
image: $DOCKER_REGISTRY/python:3.11
stage: deploy
tags:
- $CI_DOCKER_RUNNER
needs: []
before_script:
- apt-get update && apt-get install -y git git-lfs
- !reference [.create_venv, before_script]
- python -m pip install $PIP_ARGS --upgrade wheel setuptools pip build twine
script:
- git lfs pull
- python -m build
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --verbose --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
artifacts:
paths:
- dist/*.whl
rules:
- if: '$CI_PIPELINE_SOURCE == "release"'
when: always
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/'
when: always
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
allow_failure: true