Skip to content
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

atom nightly and sha update #1041

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ CEPH_SHA=latest
CEPH_DEVEL_MGR_PATH=../ceph

# Atom
ATOM_SHA=f33642d1e01df5b1a6a4140f3b31b33a4bbfd945
ATOM_SHA=9db69766f40020a2c2aa20ce795e3cedad0139d0

# Demo settings
RBD_POOL=rbd
Expand Down
40 changes: 26 additions & 14 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -665,29 +665,41 @@ jobs:
pattern: container_images_nvmeof
merge-multiple: true

- name: Cluster build and Atom tests run
if: always() && github.event_name != 'schedule'
run: |
. .env
ACTION_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
./tests/atom/clusterBuildTestsRun.sh $NVMEOF_VERSION $CEPH_SHA $ATOM_SHA $ACTION_URL
# - name: Cluster build and Atom tests run
# if: always() && github.event_name != 'schedule'
# run: |
# . .env
# ACTION_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# ./tests/atom/clusterBuildTestsRun.sh $NVMEOF_VERSION $CEPH_SHA $ATOM_SHA $ACTION_URL

- name: Cluster build and Atom nightly tests run
if: always() && github.event_name == 'schedule'
# if: always() && github.event_name == 'schedule'
run: |
. .env
ACTION_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
./tests/atom/clusterBuildTestsRun.sh $NVMEOF_VERSION $CEPH_SHA $ATOM_SHA $ACTION_URL 'nightly'

- name: Atom artifact build
if: always()
run: ./tests/atom/cpArtifactAndCleanup.sh

- uses: actions/upload-artifact@v4
if: always()
# - name: Atom artifact build
# if: always() && github.event_name != 'schedule'
# run: ./tests/atom/cpArtifactAndCleanup.sh

- name: Atom artifact build nightly
# if: always() && github.event_name == 'schedule'
run: ./tests/atom/cpArtifactAndCleanup.sh 'nightly'

- name: Upload artifact for non-schedule events
uses: actions/upload-artifact@v4
if: always() && github.event_name != 'schedule'
with:
name: atom-artifact
path: /home/cephnvme/artifact_m6.tar.gz

- name: Upload artifact for schedule events
uses: actions/upload-artifact@v4
# if: always() && github.event_name == 'schedule'
with:
name: atom-artifact
path: /home/cephnvme/artifact.tar.gz
path: /home/cephnvme/artifact_m7.tar.gz

push-images-to-ceph-registry:
if: github.event_name == 'release'
Expand Down
60 changes: 38 additions & 22 deletions tests/atom/clusterBuildTestsRun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,51 @@ set -e

VERSION=$1
if [ "$2" = "latest" ]; then
CEPH_SHA=$(curl -s https://shaman.ceph.com/api/repos/ceph/main/latest/centos/9/ | jq -r ".[] | select(.archs[] == \"$(uname -m)\" and .status == \"ready\") | .sha1")
# CEPH_SHA=$(curl -s https://shaman.ceph.com/api/repos/ceph/main/latest/centos/9/ | jq -r ".[] | select(.archs[] == \"$(uname -m)\" and .status == \"ready\") | .sha1")
CEPH_SHA=b5c07ab4f77bffd19c88ef47141176982670de94
else
CEPH_SHA=$2
fi
ATOM_SHA=$3
ACTION_URL=$4
NIGHTLY=$5

RUNNER_FILDER='/home/cephnvme/actions-runner-ceph'
RUNNER_FOLDER='/home/cephnvme/actions-runner-ceph'
BUSY_FILE='/home/cephnvme/busyServer.txt'
RUNNER_NIGHTLY_FOLDER='/home/cephnvme/actions-runner-ceph-nightly'
BUSY_NIGHTLY_FILE='/home/cephnvme/busyServerNightly.txt'

# Check if cluster is busy with another run
while true; do
if [ -f "/home/cephnvme/busyServer.txt" ]; then
echo "The server is busy with another github action job, please wait..."
sleep 90
else
echo "The server is available for use!"
echo $ACTION_URL > /home/cephnvme/busyServer.txt
chmod +rx /home/cephnvme/busyServer.txt
break
fi
done
check_cluster_busy() {
local busy_file=$1
local action_url=$2

while true; do
if [ -f "$busy_file" ]; then
echo "The server is busy with another GitHub Action job, please wait..."
sleep 90
else
echo "The server is available for use!"
echo "$action_url" > "$busy_file"
chmod +rx "$busy_file"
break
fi
done
}

# Remove previous run data
hostname
rm -rf $RUNNER_FILDER/ceph-nvmeof-atom
sudo rm -rf /root/.ssh/atom_backup/artifact/multiIBMCloudServers_m6/*
sudo ls -lta /root/.ssh/atom_backup/artifact/multiIBMCloudServers_m6
if [ "$5" != "nightly" ]; then
rm -rf $RUNNER_FOLDER/ceph-nvmeof-atom
sudo rm -rf /root/.ssh/atom_backup/artifact/multiIBMCloudServers_m6/*
sudo ls -lta /root/.ssh/atom_backup/artifact/multiIBMCloudServers_m6
cd $RUNNER_FOLDER
else
rm -rf $RUNNER_NIGHTLY_FOLDER/ceph-nvmeof-atom
sudo rm -rf /root/.ssh/atom_backup/artifact/multiIBMCloudServers_m7/*
sudo ls -lta /root/.ssh/atom_backup/artifact/multiIBMCloudServers_m7
cd $RUNNER_NIGHTLY_FOLDER
fi

# Cloning atom repo
cd $RUNNER_FILDER
git clone git@github.ibm.com:NVME-Over-Fiber/ceph-nvmeof-atom.git

# Switch to given SHA
Expand All @@ -50,6 +64,7 @@ sudo docker build -t nvmeof_atom:$ATOM_SHA .

set -x
if [ "$5" != "nightly" ]; then
check_cluster_busy "$BUSY_FILE" "$ACTION_URL"
sudo docker run \
-v /root/.ssh:/root/.ssh \
nvmeof_atom:"$ATOM_SHA" \
Expand Down Expand Up @@ -81,13 +96,14 @@ if [ "$5" != "nightly" ]; then
--nvmeof-daemon-remove \
--redeploy-gws \
--github-action-deployment \
--dont-use-mtls \
--mtls \
--journalctl-to-console \
--dont-power-off-cloud-vms \
--ibm-cloud-key=nokey \
--github-nvmeof-token=nokey \
--env=m6
else
check_cluster_busy "$BUSY_NIGHTLY_FILE" "$ACTION_URL"
sudo docker run \
-v /root/.ssh:/root/.ssh \
nvmeof_atom:"$ATOM_SHA" \
Expand Down Expand Up @@ -119,12 +135,12 @@ else
--nvmeof-daemon-remove \
--redeploy-gws \
--github-action-deployment \
--dont-use-mtls \
--journalctl-to-console \
--dont-power-off-cloud-vms \
--dont-use-hugepages \
--concise-output \
--ibm-cloud-key=nokey \
--github-nvmeof-token=nokey \
--env=m6
--env=m7
fi
set +x
44 changes: 33 additions & 11 deletions tests/atom/cpArtifactAndCleanup.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
#!/bin/bash

sudo rm -rf /home/cephnvme/artifact/*
sudo ls -lta /home/cephnvme/artifact
NIGHTLY=$1

sudo rm -rf /home/cephnvme/artifact.tar.gz
sudo ls -lta /home/cephnvme/
process_artifacts() {
local artifact_dir=$1
local backup_dir=$2
local tar_file=$3
local busy_file=$4

sudo cp -r /root/.ssh/atom_backup/artifact/multiIBMCloudServers_m6 /home/cephnvme/artifact
sudo ls -lta /home/cephnvme/artifact
sudo rm -rf "${artifact_dir:?}"/*
sudo ls -lta "$artifact_dir"

sudo tar -czf /home/cephnvme/artifact.tar.gz -C /home/cephnvme/artifact .
sudo ls -lta /home/cephnvme/artifact
sudo ls -lta /home/cephnvme
sudo chmod +rx /home/cephnvme/artifact.tar.gz
sudo rm -rf /home/cephnvme/busyServer.txt
sudo rm -rf "$tar_file"
sudo ls -lta "$(dirname "$artifact_dir")"
sudo cp -r "$backup_dir" "$artifact_dir"
sudo ls -lta "$artifact_dir"

sudo tar -czf "$tar_file" -C "$artifact_dir" .
sudo ls -lta "$artifact_dir"
sudo ls -lta "$(dirname "$artifact_dir")"
sudo chmod +rx "$tar_file"
sudo rm -rf "$busy_file"
}

if [ "$NIGHTLY" != "nightly" ]; then
process_artifacts \
"/home/cephnvme/artifact_m6" \
"/root/.ssh/atom_backup/artifact/multiIBMCloudServers_m6" \
"/home/cephnvme/artifact_m6.tar.gz" \
"/home/cephnvme/busyServer.txt"
else
process_artifacts \
"/home/cephnvme/artifact_m7" \
"/root/.ssh/atom_backup/artifact/multiIBMCloudServers_m7" \
"/home/cephnvme/artifact_m7.tar.gz" \
"/home/cephnvme/busyServerNightly.txt"
fi
Loading