Skip to content

Commit

Permalink
action: test sha256 format image
Browse files Browse the repository at this point in the history
Signed-off-by: Yadong Ding <[email protected]>
  • Loading branch information
Desiki-high committed Jan 12, 2024
1 parent 7645aaf commit 5dd3ff6
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ jobs:
NYDUS_VERSION=$(curl https://api.github.com/repos/Dragonflyoss/nydus/releases/latest | jq -r '.tag_name')
wget https://github.com/dragonflyoss/image-service/releases/download/${NYDUS_VERSION}/nydus-static-${NYDUS_VERSION}-linux-amd64.tgz
sudo tar xzvf nydus-static-${NYDUS_VERSION}-linux-amd64.tgz --wildcards --strip-components=1 -C /usr/bin/ nydus-static/*
./script/integration/nydus/test.sh ${{ env.OCI_IMAGE_NAME }}
sha256=$(docker images --digests | awk '/${{ env.OCI_IMAGE_NAME }}.*sha256/ {print $3}')
./script/integration/nydus/test.sh ${{ env.OCI_IMAGE_NAME }} ${sha256}
- name: Test eStargz Driver
run: |
./script/integration/estargz/test.sh ${{ env.OCI_IMAGE_NAME }}
sha256=$(docker images --digests | awk '/${{ env.OCI_IMAGE_NAME }}.*sha256/ {print $3}')
./script/integration/estargz/test.sh ${{ env.OCI_IMAGE_NAME }} ${sha256}
- name: Test one-time mode
run: |
Expand Down
51 changes: 51 additions & 0 deletions script/integration/nydus/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@
set -euo pipefail

OCI_IMAGE_NAME=$1
SHA256=$2

check_tasks_status() {
while true; do
# Check tasks list
./accelctl task list

# Get tasks status
status=$(./accelctl task list | tail -n +2 | awk '{print $4}')

# Check any FAILED
if echo "$status" | grep -q "FAILED"; then
cat acceld.log
echo "Found a task failed"
exit 1
fi

# Check if all tasks completed
if echo "$status" | grep -q "PROCESSING"; then
sleep 10
cat acceld.log
else
break
fi
done
}

# Start acceld service
sudo nohup ./acceld --config ./misc/config/config.nydus.yaml &> acceld.log &
Expand All @@ -11,10 +37,35 @@ sleep 1
# Convert image by accelctl
sudo ./accelctl task create --sync localhost/library/$OCI_IMAGE_NAME:latest

check_tasks_status

# Verify filesystem consistency for converted image
sudo /usr/bin/nydusify check \
--source localhost/library/$OCI_IMAGE_NAME:latest \
--target localhost/library/$OCI_IMAGE_NAME:latest-nydus

# Convert image by accelctl
sudo ./accelctl task create --sync localhost/library/$OCI_IMAGE_NAME:latest@$SHA256

check_tasks_status

# Verify filesystem consistency for converted image
sudo /usr/bin/nydusify check \
--source localhost/library/$OCI_IMAGE_NAME:latest@$SHA256 \
--target localhost/library/$OCI_IMAGE_NAME:latest-nydus

# Convert image by accelctl
sudo ./accelctl task create --sync localhost/library/$OCI_IMAGE_NAME@$SHA256

check_tasks_status

# Verify filesystem consistency for converted image
sudo /usr/bin/nydusify check \
--source localhost/library/$OCI_IMAGE_NAME@$SHA256 \
--target localhost/library/$OCI_IMAGE_NAME:latest-nydus

# check acceld log
cat acceld.log

# Gracefully exit acceld
sudo pkill -SIGINT acceld

0 comments on commit 5dd3ff6

Please sign in to comment.