Skip to content

Commit aecdfc8

Browse files
authored
Merge branch 'main' into dependabot/pip/rich-gte-13.6.0-and-lt-14.1
Signed-off-by: Steven Elliott <[email protected]>
2 parents 443f5e7 + ea9b7d9 commit aecdfc8

File tree

15 files changed

+252
-208
lines changed

15 files changed

+252
-208
lines changed

.github/actions/prepare-discovery/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ runs:
99
steps:
1010
- name: Install discovery
1111
run: |
12-
wget https://github.com/mitchnegus/minimega-discovery/releases/download/firewheel-debian_faed761/discovery.deb
12+
wget https://github.com/sandia-minimega/discovery/releases/download/v0.1.0/discovery.deb
1313
sudo dpkg -i discovery.deb
1414
sudo chown -R $USER:minimega /opt/discovery
1515
shell: bash

.gitlab-ci.yml

Lines changed: 17 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -5,102 +5,10 @@
55
# on a variety of operating systems and versions of
66
# Python.
77
#
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-
#
118
###############################
129

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
10412

10513
###############################
10614
# Creating a few defaults and setting up the Pipeline stages.
@@ -123,18 +31,18 @@ stages:
12331
###############################
12432

12533
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
13434
stage: test
135-
needs: []
13635
tags:
13736
- 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]
13846
script:
13947
- pushd /opt/firewheel
14048
# Enable FW to cache images
@@ -163,19 +71,18 @@ performance-ubuntu2204:
16371
paths:
16472
- profile
16573

166-
16774
###############################
16875
# Create Documentation
16976
###############################
17077
docs:
17178
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
17779
stage: lint
17880
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]
17986
script:
18087
- tox -e dependencies,docs
18188
- mkdir documentation
@@ -191,7 +98,6 @@ docs:
19198
tags:
19299
- $CI_DOCKER_RUNNER
193100

194-
195101
pages:
196102
image: $DOCKER_REGISTRY/python:3.11
197103
before_script:
@@ -214,12 +120,8 @@ build:
214120
image: $DOCKER_REGISTRY/python:3.11
215121
stage: deploy
216122
before_script:
217-
- python --version ; pip --version
218123
- 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]
223125
- python -m pip install $PIP_ARGS --upgrade wheel setuptools pip build twine
224126
script:
225127
- git lfs pull

.gitlab/ci/setup.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
###########################################################
2+
# Setup for FIREWHEEL Continuous Integration
3+
#
4+
# Use reference tags to deduplicate CI functionality
5+
# and speed up the execution of pipeline jobs which do
6+
# not require each component.
7+
#
8+
# See: https://docs.gitlab.com/ci/yaml/yaml_optimization
9+
#
10+
###########################################################
11+
12+
variables:
13+
BASE_PYTHON: python
14+
MM_INSTALL_DIR: /opt/minimega
15+
FIREWHEEL_ROOT_DIR: /opt/firewheel
16+
FIREWHEEL_VENV: $FIREWHEEL_ROOT_DIR/venv
17+
18+
# Create a Python virtual environment
19+
.create_venv:
20+
before_script:
21+
- $BASE_PYTHON --version
22+
- $BASE_PYTHON -m pip --version
23+
- $BASE_PYTHON -m venv $FIREWHEEL_VENV
24+
- source $FIREWHEEL_VENV/bin/activate
25+
26+
# Install the FIREWHEEL Python package and any Python dependencies
27+
.install_firewheel_package:
28+
before_script:
29+
- python -m pip install $PIP_ARGS -U build setuptools pip
30+
- python -m build
31+
- python -m pip install -e .[dev,mcs]
32+
33+
# Install FIREWHEEL and all dependencies (including minimega)
34+
.install_firewheel:
35+
before_script:
36+
- sudo killall minimega # Make sure minimega is not running
37+
- sudo systemctl restart minimega
38+
- !reference [.install_firewheel_package, before_script]
39+
40+
# Set the default FIREWHEEL configuration
41+
.configure_firewheel:
42+
before_script:
43+
- firewheel config set -s system.default_output_dir "$(pwd)/logs"
44+
- firewheel config set -s cluster.compute $(hostname)
45+
- firewheel config set -s cluster.control $(hostname)
46+
- firewheel config set -s discovery.hostname 127.0.0.1
47+
- firewheel config set -s grpc.hostname 127.0.0.1
48+
- firewheel config set -s minimega.experiment_interface lo
49+
- firewheel config set -s minimega.install_dir $MM_INSTALL_DIR
50+
- firewheel config set -s python.venv $FIREWHEEL_VENV
51+
- firewheel config set -s python.bin python
52+
53+
# Configure FIREWHEEL for use in Docker containers
54+
.configure_firewheel_docker:
55+
before_script:
56+
- !reference [.configure_firewheel, before_script]
57+
- firewheel config set -s system.default_group root # Docker
58+
- python ./src/firewheel/lib/grpc/firewheel_grpc_server.py &
59+
60+
# Initialize FIREWHEEL (including configuration)
61+
.initialize_firewheel:
62+
before_script:
63+
- !reference [.configure_firewheel, before_script]
64+
- firewheel init
65+
- firewheel sync
66+
- firewheel restart hard
67+
68+
# Clone and/or install basic Model Component repositories
69+
.install_mcs:
70+
before_script:
71+
- |
72+
pip install $PIP_ARGS firewheel-repo-base firewheel-repo-tutorials \
73+
firewheel-repo-linux firewheel-repo-vyos \
74+
firewheel-repo-layer2 firewheel-repo-ntp firewheel-repo-dns
75+
- mkdir $FIREWHEEL_ROOT_DIR/model_components
76+
- pushd $FIREWHEEL_ROOT_DIR/model_components
77+
# Skip LFS files, we'll get them from the bin repo. Once open-source is
78+
# complete, the env var can be removed and this can be pip installed
79+
- GIT_LFS_SKIP_SMUDGE=1 git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/firewheel/firewheel_repo_utilities.git
80+
- firewheel repository install firewheel_repo_utilities
81+
- popd
82+
83+
# Move MC binaries into the appropriate locations
84+
.provision_mcs:
85+
before_script:
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+
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${UTILITIES_BIN_REPO_PATH} /tmp/utilities
91+
- SITE_PACKAGES=$(python3 -c 'import sysconfig; print(sysconfig.get_path("purelib"))')
92+
- mv /tmp/ntp/ntp/ntp-trusty-server.tar "$SITE_PACKAGES/firewheel_repo_ntp/ntp/vm_resources/"
93+
- mv /tmp/dns/dns_objects/vm_resources/bind9_xenial_debs.tgz "$SITE_PACKAGES/firewheel_repo_dns/dns_objects/vm_resources/bind9_xenial_debs.tgz"
94+
- mv /tmp/vyos/vyos-1.1.8/vyos-1.1.8.qc2.xz "$SITE_PACKAGES/firewheel_repo_vyos/vyos-1.1.8/"
95+
- mv /tmp/linux/linux/vm_resources/*.tgz "$SITE_PACKAGES/firewheel_repo_linux/linux/vm_resources"
96+
- mv /tmp/linux/ubuntu/ubuntu/vm_resources/debs/*.tgz "$SITE_PACKAGES/firewheel_repo_linux/ubuntu/ubuntu/vm_resources/debs/"
97+
- mv /tmp/linux/ubuntu/bionic/images/ubuntu* "$SITE_PACKAGES/firewheel_repo_linux/ubuntu/bionic/images/"
98+
- mv /tmp/linux/ubuntu/jammy/images/ubuntu* "$SITE_PACKAGES/firewheel_repo_linux/ubuntu/jammy/images/"
99+
- mv /tmp/linux/ubuntu/jammy/vm_resources/debs/*.tgz "$SITE_PACKAGES/firewheel_repo_linux/ubuntu/jammy/vm_resources/debs/"
100+
- mv /tmp/linux/ubuntu/trusty/images/ubuntu* "$SITE_PACKAGES/firewheel_repo_linux/ubuntu/trusty/images/"
101+
- mv /tmp/linux/ubuntu/trusty/vm_resources/debs/*.tgz "$SITE_PACKAGES/firewheel_repo_linux/ubuntu/trusty/vm_resources/debs/"
102+
- mv /tmp/linux/ubuntu/xenial/images/ubuntu* "$SITE_PACKAGES/firewheel_repo_linux/ubuntu/xenial/images/"
103+
- pushd /tmp/utilities; cp -r --parents * $FIREWHEEL_ROOT_DIR/model_components/firewheel_repo_utilities/; popd;

docker/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,14 @@ To enable FIREWHEEL to work properly (without any modifications) the docker base
8989
These include:
9090
- `sudo` - and specifically `sudo systemctl`
9191
- `chgrp`
92-
- `scp`
93-
- `ssh`
9492

9593
Therefore, we have created wrappers around these programs to adjust the behavior.
96-
However, the original programs have been kept/renamed to `<progname>-old` (e.g., `ssh-old`).
94+
However, the original programs have been kept/renamed to `<progname>-old` (e.g., `chgrp-old`).
9795
Therefore, if these programs are needed, they are still available, but will not be used by FIREWHEEL.
9896

9997
### Minimega Differences
10098
The minimega container provides a [`start-minimega.sh`](https://github.com/sandia-minimega/minimega/blob/master/docker/start-minimega.sh) script which is overwritten by a customized version in the FIREWHEEL container.
10199
The primary difference between these scripts is the addition of logging various errors and exiting early if minimega is already running.
102100

103101
Additionally, we include a minimega environment variables configuration file (described above) which can be used/changed as needed.
104-
Within the container it is located at `/etc/default/minimega`.
102+
Within the container it is located at `/etc/default/minimega`.

docker/firewheel.dockerfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
1818
ethtool libpcap-dev openvswitch-switch qemu-kvm qemu-utils \
1919
dnsmasq ntfs-3g iproute2 qemu-system-x86 software-properties-common \
2020
dosfstools openssh-server locales locales-all python3.10 python3.10-venv \
21-
vim psmisc && \
21+
vim psmisc iputils-ping && \
2222
apt-get clean && rm -rf /var/lib/apt/lists/* || { echo "Package installation failed"; exit 1; }
2323

2424
### Locale support ###
@@ -82,15 +82,11 @@ RUN bash -c "source /fwpy/bin/activate && \
8282

8383
RUN firewheel repository install -s -i || { echo "Repository installation failed"; exit 1; }
8484

85-
RUN cp /usr/bin/ssh /usr/bin/ssh-old && \
86-
cp /usr/bin/scp /usr/bin/scp-old && \
87-
cp /usr/bin/sudo /usr/bin/sudo-old && \
85+
RUN cp /usr/bin/sudo /usr/bin/sudo-old && \
8886
cp /usr/bin/chgrp /usr/bin/chgrp-old
8987

9088
COPY docker/fsroot/ /
9189
RUN chmod +x /usr/local/bin/entry && \
92-
chmod +x /usr/bin/ssh && \
93-
chmod +x /usr/bin/scp && \
9490
chmod +x /usr/bin/sudo && \
9591
chmod +x /usr/bin/chgrp && \
9692
chmod +x /start-minimega.sh

docker/fsroot/usr/bin/scp

Lines changed: 0 additions & 11 deletions
This file was deleted.

docker/fsroot/usr/bin/ssh

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)