5
5
# on a variety of operating systems and versions of
6
6
# Python.
7
7
#
8
- # It makes heavy use of YAML Anchors and extends to save space.
9
- # see: https://docs.gitlab.com/ce/ci/yaml/README.html#anchors
10
- #
11
8
# ##############################
12
9
13
-
14
- # ##############################
15
- # Setting up before_script anchors to speed up the execution of
16
- # pipeline jobs which do not require each component.
17
- # See: https://docs.gitlab.com/ee/ci/yaml/#yaml-anchors-for-before_script-and-after_script
18
- #
19
- # This includes:
20
- # * create_venv_docker: Creating a Python 3.10 virtual environment
21
- # * install_firewheel: Install FIREWHEEL and any dependencies.
22
- # * configure_firewheel: Configure FIREWHEEL for use by the job.
23
- # * install_mcs: Clone the base and linux Model Component repositories.
24
- # ##############################
25
- .create_venv_docker : &create_venv_docker
26
- - python --version ; pip --version
27
- - pip install $PIP_ARGS virtualenv
28
- - virtualenv venv
29
- - source venv/bin/activate
30
-
31
- .install_firewheel_docker : &install_firewheel_docker
32
- - python -m pip install $PIP_ARGS -U build setuptools pip
33
- - python -m build
34
- - python -m pip install -e .[dev]
35
-
36
- .install_firewheel : &install_firewheel
37
- - sudo killall minimega # Make sure minimega is not running
38
- - sudo systemctl restart minimega
39
- - *install_firewheel_docker
40
-
41
- .set_config : &set_config
42
- - firewheel config set -s system.default_output_dir "$(pwd)/logs"
43
- - firewheel config set -s cluster.compute $(hostname)
44
- - firewheel config set -s cluster.control $(hostname)
45
- - firewheel config set -s discovery.hostname 127.0.0.1
46
- - firewheel config set -s grpc.hostname 127.0.0.1
47
- - firewheel config set -s minimega.experiment_interface lo
48
- - firewheel config set -s minimega.install_dir /opt/minimega
49
- - firewheel config set -s python.venv $(pwd)/venv
50
- - firewheel config set -s python.bin python3
51
-
52
- .configure_firewheel_docker : &configure_firewheel_docker
53
- - *set_config
54
- - firewheel config set -s system.default_group root
55
- - python ./src/firewheel/lib/grpc/firewheel_grpc_server.py &
56
-
57
- .configure_firewheel : &configure_firewheel
58
- - *set_config
59
- - firewheel init
60
- - firewheel sync
61
- - firewheel restart hard
62
-
63
- .install_mcs_docker : &install_mcs_docker
64
- - mkdir model_components
65
- - pip install $PIP_ARGS firewheel-repo-base firewheel-repo-tutorials
66
- - pushd model_components
67
- - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/firewheel_repo_linux.git
68
- - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/firewheel_repo_utilities.git
69
- - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/firewheel_repo_layer2.git
70
- - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/firewheel_repo_ntp.git
71
- - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/firewheel_repo_dns.git
72
- - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/firewheel_repo_vyos.git
73
- - firewheel repository install linux
74
- - firewheel repository install utilities
75
- - firewheel repository install layer2
76
- - firewheel repository install ntp
77
- - firewheel repository install dns
78
- - firewheel repository install vyos
79
- - popd
80
-
81
-
82
- .install_mcs : &install_mcs
83
- - pushd /opt/firewheel/
84
- - *install_mcs_docker
85
- - pushd model_components
86
- - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${NTP_BIN_REPO_PATH} /tmp/ntp
87
- - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${DNS_BIN_REPO_PATH} /tmp/dns
88
- - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${VYOS_BIN_REPO_PATH} /tmp/vyos
89
- - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${LINUX_BIN_REPO_PATH} /tmp/linux
90
- - mv /tmp/ntp/ntp/ntp-trusty-server.tar /opt/firewheel/model_components/firewheel_repo_ntp/src/firewheel_repo_ntp/ntp/vm_resources/
91
- - mv /tmp/dns/dns_objects/vm_resources/bind9_xenial_debs.tgz /opt/firewheel/model_components/firewheel_repo_dns/src/firewheel_repo_dns/dns_objects/vm_resources/bind9_xenial_debs.tgz
92
- - mv /tmp/vyos/vyos-1.1.8/vyos-1.1.8.qc2.xz /opt/firewheel/model_components/firewheel_repo_vyos/src/firewheel_repo_vyos/vyos-1.1.8/
93
- - mv /tmp/linux/linux/vm_resources/*.tgz /opt/firewheel/model_components/firewheel_repo_linux/src/firewheel_repo_linux/linux/vm_resources
94
- - mv /tmp/linux/ubuntu/ubuntu/vm_resources/debs/*.tgz /opt/firewheel/model_components/firewheel_repo_linux/src/firewheel_repo_linux/ubuntu/ubuntu/vm_resources/debs/
95
- - mv /tmp/linux/ubuntu/bionic/images/ubuntu* /opt/firewheel/model_components/firewheel_repo_linux/src/firewheel_repo_linux/ubuntu/bionic/images/
96
- - mv /tmp/linux/ubuntu/jammy/images/ubuntu* /opt/firewheel/model_components/firewheel_repo_linux/src/firewheel_repo_linux/ubuntu/jammy/images/
97
- - mv /tmp/linux/ubuntu/jammy/vm_resources/debs/*.tgz /opt/firewheel/model_components/firewheel_repo_linux/src/firewheel_repo_linux/ubuntu/jammy/vm_resources/debs/
98
- - mv /tmp/linux/ubuntu/trusty/images/ubuntu* /opt/firewheel/model_components/firewheel_repo_linux/src/firewheel_repo_linux/ubuntu/trusty/images/
99
- - mv /tmp/linux/ubuntu/trusty/vm_resources/debs/*.tgz /opt/firewheel/model_components/firewheel_repo_linux/src/firewheel_repo_linux/ubuntu/trusty/vm_resources/debs/
100
- - mv /tmp/linux/ubuntu/xenial/images/ubuntu* /opt/firewheel/model_components/firewheel_repo_linux/src/firewheel_repo_linux/ubuntu/xenial/images/
101
- - popd
102
- - popd
103
-
10
+ include :
11
+ - local : .gitlab/ci/setup.yml
104
12
105
13
# ##############################
106
14
# Creating a few defaults and setting up the Pipeline stages.
@@ -123,18 +31,18 @@ stages:
123
31
# ##############################
124
32
125
33
performance-ubuntu2204 :
126
- before_script :
127
- - pushd /opt/firewheel/
128
- - python3.10 -m venv venv
129
- - source /opt/firewheel/venv/bin/activate
130
- - popd
131
- - *install_firewheel
132
- - *configure_firewheel
133
- - *install_mcs
134
34
stage : test
135
- needs : []
136
35
tags :
137
36
- ubuntu2204
37
+ needs : []
38
+ variables :
39
+ BASE_PYTHON : python3.10
40
+ before_script :
41
+ - !reference [.create_venv, before_script]
42
+ - !reference [.install_firewheel, before_script]
43
+ - !reference [.configure_firewheel, before_script]
44
+ - !reference [.install_mcs, before_script]
45
+ - !reference [.provision_mcs, before_script]
138
46
script :
139
47
- pushd /opt/firewheel
140
48
# Enable FW to cache images
@@ -163,19 +71,18 @@ performance-ubuntu2204:
163
71
paths :
164
72
- profile
165
73
166
-
167
74
# ##############################
168
75
# Create Documentation
169
76
# ##############################
170
77
docs :
171
78
image : $DOCKER_REGISTRY/python:3.11
172
- before_script :
173
- - *create_venv_docker
174
- - *install_firewheel_docker
175
- - *configure_firewheel_docker
176
- - *install_mcs_docker
177
79
stage : lint
178
80
needs : []
81
+ before_script :
82
+ - !reference [.create_venv, before_script]
83
+ - !reference [.install_firewheel_package, before_script]
84
+ - !reference [.configure_firewheel_docker, before_script]
85
+ - !reference [.install_mcs, before_script]
179
86
script :
180
87
- tox -e dependencies,docs
181
88
- mkdir documentation
191
98
tags :
192
99
- $CI_DOCKER_RUNNER
193
100
194
-
195
101
pages :
196
102
image : $DOCKER_REGISTRY/python:3.11
197
103
before_script :
@@ -214,12 +120,8 @@ build:
214
120
image : $DOCKER_REGISTRY/python:3.11
215
121
stage : deploy
216
122
before_script :
217
- - python --version ; pip --version
218
123
- apt-get update && apt-get install -y git git-lfs
219
- - git lfs install
220
- - pip install virtualenv
221
- - virtualenv venv
222
- - source venv/bin/activate
124
+ - !reference [.create_venv, before_script]
223
125
- python -m pip install $PIP_ARGS --upgrade wheel setuptools pip build twine
224
126
script :
225
127
- git lfs pull
0 commit comments