-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move deployment tests to CI-run and re-enable integration tests #151
Open
viniciusdc
wants to merge
44
commits into
main
Choose a base branch
from
cirun-setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 34 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
7271d15
Use cirun for testing
aktech 819c219
trigger run for cirun runner
aktech 01fb47b
Re-enable deployment run
viniciusdc 24b9efd
restrict trigger criteria for linting dirs
viniciusdc 3e97e35
include python setup
viniciusdc 50b998d
add concurrency group and fix pip calls
viniciusdc cf1604f
disable concurrent group and restrict trigger dirs
viniciusdc d897096
add install vagrant step
viniciusdc 8ee1e44
tmp replace ci runner for github hosted for fast test response
viniciusdc b6792b1
libvirt installation and validation
viniciusdc 4b1dc81
libvirt installation and validation
viniciusdc cd313ed
libvirt installation and validation
viniciusdc e068359
include libvirt plugin setup
viniciusdc 338e059
fix bug with deps
viniciusdc cbdc942
re-enable cirun runner
viniciusdc 7061288
Update kvm-test.yaml
viniciusdc 6f8df3e
reorganize GitHub Actions workflow for Vagrant (KVM) tests
viniciusdc 3d757bf
fix: rename host_vars file from hpc01-test.yaml to localhost.yaml for…
viniciusdc fe8836e
Refactor local testing
viniciusdc dcabe9b
update CI workflow to run on ubuntu-latest and improve network info e…
viniciusdc 3b81ba5
fix: update script to use 'ip address show' for broader compatibility…
viniciusdc d6b802a
fix: 'become: true' was mistakenly removed
viniciusdc 7921c6b
chore: fix identation and update timeout value for nfs wait_for task …
viniciusdc 104cbb7
chore: remove redundant 'cmd' attribute and update notification messa…
viniciusdc 534eccc
fix: incorrect placements of timeouts
viniciusdc 8d5c6d3
chore: re-enable ci-run for KVM Test job
viniciusdc 4ad5007
fix: update CI job to address /var/lib/dpkg/lock-frontend issue and k…
viniciusdc cb28bc0
chore: simplify killing process holding lock by using 'killall' command
viniciusdc d1fe0df
chore: update file permissions and paths for Slurm configuration file…
viniciusdc 01d4a23
chore: re-enable CI to run on ubuntu-latest
viniciusdc e94366c
test new config
viniciusdc 4c640d7
ensure systemd task is executed by root
viniciusdc 058b519
update group_vars LDAP server url
viniciusdc 2dd4317
increase MySQL packages install time
viniciusdc 4581309
Increase instance size
viniciusdc de458a8
Split partial/full dpeloyment ansible runs
viniciusdc acaf5a6
Update AMI us-east-1-Jellyfish-22.04-amd64
viniciusdc f9e3cb4
Ubuntu Server 22.04 LTS (HVM) x86
viniciusdc afcd1b5
Update AMI instance Ubuntu Server 20.04
viniciusdc 91eebfc
double timeout for postgresql packages install
viniciusdc d9dda48
move long demanding installs to pre-install
viniciusdc 93b8d1a
addess postgresql install
viniciusdc 660f24f
add debug session
viniciusdc 36b0e8e
test disk usage
viniciusdc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
runners: | ||
- name: cirun-aws-runner | ||
# Cloud Provider: AWS | ||
cloud: aws | ||
# Instance Type has 4 vcpu, 16 GiB memory, Up to 5 Gbps Network Performance | ||
instance_type: t3a.2xlarge | ||
viniciusdc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
machine_image: ami-0a388df278199ff52 | ||
viniciusdc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Region: Oregon | ||
region: us-west-2 | ||
# Use Spot Instances for cost savings | ||
preemptible: | ||
- true | ||
- false | ||
labels: | ||
- cirun-runner | ||
Check failure on line 15 in .cirun.yml GitHub Actions / Ansible Lintyaml[new-line-at-end-of-file]
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
IFS=$'\n' # Split output into lines based on newline | ||
|
||
# Use `ip address show` instead of `ip -br -4 address show` for broader compatibility | ||
readarray -t lines <<< "$(ip -br -4 address show | grep UP)" | ||
for line in "${lines[@]}"; do | ||
if [[ $line =~ (eth[0-9]|ens[0-9]+|enp[0-9].*) ]]; then | ||
INTERFACE=$(echo $line | awk '{print $1}') | ||
IP_RANGE=$(echo $line | awk '{print $3}') | ||
break | ||
fi | ||
done | ||
|
||
# Write variables into network_info.txt | ||
echo "Interface: $INTERFACE" > network_info.txt | ||
echo "IP Range: $IP_RANGE" >> network_info.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Check if the correct number of arguments was provided | ||
if [ $# -ne 2 ]; then | ||
echo "Usage: $0 <hostname> <output_path>" | ||
exit 1 | ||
fi | ||
|
||
# Get the hostname from the first argument | ||
HOSTNAME=$1 | ||
|
||
# Get the output path from the second argument | ||
OUTPUT_PATH=$2 | ||
|
||
# Ensure the directory exists | ||
mkdir -p $(dirname "$OUTPUT_PATH") | ||
|
||
# Create the inventory.ini file at the specified output path with dynamic content | ||
cat <<EOF > "$OUTPUT_PATH" | ||
${HOSTNAME} connection=local ansible_ssh_host=127.0.0.1 | ||
|
||
[hpc_master] | ||
${HOSTNAME} | ||
|
||
[hpc_worker] | ||
${HOSTNAME} | ||
EOF | ||
|
||
echo "inventory.ini file has been created at $OUTPUT_PATH." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,112 @@ | ||
--- | ||
name: Vagrant (KVM) Tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
# https://github.com/jonashackt/vagrant-github-actions | ||
test-kvm: | ||
name: KVM Test | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache Vagrant boxes | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.vagrant.d/boxes | ||
key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }} | ||
restore-keys: | | ||
${{ runner.os }}-vagrant- | ||
|
||
- name: Install test dependencies. | ||
run: sudo pip3 install ansible | ||
|
||
- name: Install Ansible Dependencies | ||
working-directory: tests/ubuntu2004-singlenode | ||
run: | | ||
ansible-galaxy collection install community.general | ||
ansible-galaxy collection install ansible.posix | ||
|
||
- name: Show Vagrant version | ||
run: vagrant --version | ||
|
||
# Disabled until we fix it | ||
# - name: Run vagrant up | ||
# working-directory: tests/ubuntu2004-singlenode | ||
# run: vagrant up | ||
name: Vagrant (KVM) Tests | ||
Check failure on line 2 in .github/workflows/kvm-test.yaml GitHub Actions / Ansible Lintyaml[indentation]
|
||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test-kvm: | ||
name: KVM Test | ||
# Disable ci-run untill addressing /var/lib/dpkg/lock-frontend issue | ||
runs-on: "cirun-runner--${{ github.run_id }}" | ||
# runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install ansible | ||
|
||
- name: Install Ansible dependencies | ||
run: | | ||
ansible-galaxy collection install -r requirements.yaml | ||
|
||
- name: Create deploy folder and move inventory files | ||
run: | | ||
mkdir deploy | ||
cp -r inventory.template/* deploy/ | ||
|
||
chmod +x .github/scripts/gen_inventory.sh | ||
./.github/scripts/gen_inventory.sh $(hostname -s) deploy/inventory.ini | ||
|
||
- name: Check network adapter | ||
run: | | ||
ip a | ||
|
||
- name: Check hosts | ||
run: | | ||
cat /etc/hosts | ||
|
||
- name: Extract Network Information | ||
run: | | ||
chmod +x .github/scripts/extract_network_info.sh | ||
./.github/scripts/extract_network_info.sh | ||
echo "adapter_name=$(cat network_info.txt | head -1 | awk '{print $2}')" >> $GITHUB_ENV | ||
echo "ip_range=$(cat network_info.txt | awk 'NR > 1 && $3 {print $3}')" >> $GITHUB_ENV | ||
|
||
- name: Update group vars | ||
run: | | ||
cp deploy/group_vars/all.yaml deploy/group_vars/all.yaml.bak | ||
|
||
echo "Updating group vars for firewall and internal network" | ||
echo "firewall_internal_ip_range: $ip_range" >> deploy/group_vars/all.yaml | ||
echo "internal_interface: $adapter_name" >> deploy/group_vars/all.yaml | ||
echo "SlurmConfigFileDIr: /etc/slurm" >> deploy/group_vars/all.yaml | ||
|
||
echo "Replace hpc01-test with $(hostname -s) in group_vars/hpc_worker.yaml file" | ||
sed -i "s/hpc01-test/$(hostname -s)/g" deploy/group_vars/hpc_worker.yaml | ||
|
||
echo "Replace LDAP server URI with $(hostname -s) in group_vars/all.yaml file" | ||
sed -i "s|ldap://hpc01-test:389|ldap://$(hostname -s):389|g" deploy/group_vars/all.yaml | ||
|
||
diff deploy/group_vars/all.yaml.bak deploy/group_vars/all.yaml || true | ||
|
||
- name: Disable unattended-upgrades | ||
run: | | ||
# Ensure all commands are non-interactive by setting DEBIAN_FRONTEND to noninteractive | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
# Check if unattended-upgrades service is active and stop it if it is | ||
if systemctl is-active --quiet unattended-upgrades; then | ||
echo "Stopping unattended-upgrades service..." | ||
sudo systemctl stop unattended-upgrades | ||
else | ||
echo "unattended-upgrades service is not active. Skipping stop command." | ||
fi | ||
|
||
# Proceed with killing any running APT processes without manual confirmation | ||
echo "Checking and killing running APT processes if necessary..." | ||
sudo lsof /var/lib/dpkg/lock-frontend | awk '{print $2}' | tail -n +2 | while read PID; do | ||
if [ ! -z "$PID" ]; then | ||
echo "Killing PID $PID" | ||
sudo kill -9 $PID | ||
fi | ||
done | ||
|
||
# Configure any packages that are in an unclean state non-interactively | ||
echo "Configuring any packages in an unclean state..." | ||
sudo dpkg --configure -a | ||
|
||
# Remove unattended-upgrades to avoid automatic background updates during script execution | ||
echo "Disabling unattended upgrades..." | ||
sudo apt-get remove --purge unattended-upgrades -y || true | ||
|
||
# - name: Run ssh session | ||
# uses: mxschmitt/action-tmate@v3 | ||
# with: | ||
# detached: true | ||
|
||
- name: Run ansible playbook | ||
run: | | ||
cd deploy | ||
ansible-playbook ../playbook.yaml -i inventory.ini --connection=local -v | ||
env: | ||
ANSIBLE_FORCE_COLOR: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
- name: Ensure restic installed | ||
become: true | ||
timeout: 300 | ||
ansible.builtin.apt: | ||
name: restic | ||
state: latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,5 @@ | |
name: "{{ item }}" | ||
enabled: "yes" | ||
state: restarted | ||
cmd: "" | ||
with_items: | ||
- smbd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
- name: Install cifs | ||
become: true | ||
timeout: 300 | ||
ansible.builtin.apt: | ||
state: latest | ||
cache_valid_time: 3600 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,5 @@ | |
name: "{{ item }}" | ||
enabled: "yes" | ||
state: restarted | ||
cmd: "" | ||
with_items: | ||
- dask-gateway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,5 @@ | |
name: "{{ item }}" | ||
enabled: "yes" | ||
state: restarted | ||
cmd: "" | ||
with_items: | ||
- mysql |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can try
t3.2xlarge
if the number of cores is the bottleneck