Skip to content

Update github workflow & acceptance versions #192

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

Merged
merged 1 commit into from
Jun 12, 2025
Merged
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
Original file line number Diff line number Diff line change
@@ -49,33 +49,57 @@ runs:
((T+=1))
sleep 30
done
# After loop, check if Cloudstack is up
if ! curl -sfSL http://localhost:8080 --output /dev/null; then
echo "Cloudstack did not become ready in time"
curl -v http://localhost:8080 || true
exit 22
fi
- name: Setting up Cloudstack
id: setup-cloudstack
shell: bash
run: |
docker exec $(docker container ls --format=json -l | jq -r .ID) python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/advanced.cfg
curl -sf --location "${CLOUDSTACK_API_URL}" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'command=login' \
--data-urlencode 'username=admin' \
--data-urlencode 'password=password' \
--data-urlencode 'response=json' \
--data-urlencode 'domain=/' -j -c cookies.txt --output /dev/null
CLOUDSTACK_USER_ID=$(curl -fs "${CLOUDSTACK_API_URL}?command=listUsers&response=json" -b cookies.txt | jq -r '.listusersresponse.user[0].id')
CLOUDSTACK_API_KEY=$(curl -s "${CLOUDSTACK_API_URL}?command=getUserKeys&id=${CLOUDSTACK_USER_ID}&response=json" -b cookies.txt | jq -r '.getuserkeysresponse.userkeys.apikey')
CLOUDSTACK_SECRET_KEY=$(curl -fs "${CLOUDSTACK_API_URL}?command=getUserKeys&id=${CLOUDSTACK_USER_ID}&response=json" -b cookies.txt | jq -r '.getuserkeysresponse.userkeys.secretkey')
set -euo pipefail
echo "Deploying Data Center..."
docker exec $(docker container ls --format=json -l | jq -r .ID) \
python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/advanced.cfg
# Get the container ID of the running simulator
CONTAINER_ID=$(docker ps --filter "ancestor=apache/cloudstack-simulator:${{ matrix.cloudstack-version }}" --format "{{.ID}}" | head -n1)
# Install CloudMonkey
docker exec $CONTAINER_ID bash -c "curl -sfSL https://github.com/apache/cloudstack-cloudmonkey/releases/download/6.4.0/cmk.linux.x86-64 -o /usr/local/bin/cmk && chmod +x /usr/local/bin/cmk"
# Write the CloudMonkey config file with a profile using user/pass
docker exec $CONTAINER_ID mkdir -p /root/.cmk
docker exec $CONTAINER_ID bash -c "printf '[core]\nprofile = localcloud\n\n[localcloud]\nurl = http://localhost:8080/client/api\nusername = admin\npassword = password\ndomain = /\napikey =\nsecretkey =\ntimeout = 3600\n' > /root/.cmk/config"
# Use CloudMonkey with the profile to list users and extract API key/secret key
docker exec $CONTAINER_ID cmk -p localcloud list users --output json > users.json
# Generate API keys
docker exec $CONTAINER_ID cmk -p localcloud registeruserKeys id=$(jq -r '.user[0].id' users.json) > api.json
# Extract the first user's keys (assuming admin is first)
CLOUDSTACK_API_KEY=$(jq -r '.userkeys.apikey' api.json)
CLOUDSTACK_SECRET_KEY=$(jq -r '.userkeys.secretkey' api.json)
CLOUDSTACK_USER_ID=$(jq -r '.user[0].id' users.json)
echo "::add-mask::$CLOUDSTACK_API_KEY"
echo "::add-mask::$CLOUDSTACK_SECRET_KEY"
echo "user_id=$CLOUDSTACK_USER_ID" >> $GITHUB_OUTPUT
echo "api_key=$CLOUDSTACK_API_KEY" >> $GITHUB_OUTPUT
echo "secret_key=$CLOUDSTACK_SECRET_KEY" >> $GITHUB_OUTPUT
- name: Install CMK
shell: bash
run: |
curl -sfL https://github.com/apache/cloudstack-cloudmonkey/releases/download/6.3.0/cmk.linux.x86-64 -o /usr/local/bin/cmk
curl -sfSL https://github.com/apache/cloudstack-cloudmonkey/releases/download/6.4.0/cmk.linux.x86-64 -o /usr/local/bin/cmk
chmod +x /usr/local/bin/cmk
- name: Create extra resources
shell: bash
14 changes: 7 additions & 7 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ permissions:

env:
CLOUDSTACK_API_URL: http://localhost:8080/client/api
CLOUDSTACK_VERSIONS: "['4.18.2.1', '4.19.0.2']"
CLOUDSTACK_VERSIONS: "['4.19.0.1', '4.19.1.3', '4.19.2.0', '4.19.3.0', '4.20.1.0']"

jobs:
prepare-matrix:
@@ -54,7 +54,7 @@ jobs:
with:
go-version-file: 'go.mod'
- name: Configure Cloudstack v${{ matrix.cloudstack-version }}
uses: ./.github/workflows/setup-cloudstack
uses: ./.github/actions/setup-cloudstack
id: setup-cloudstack
with:
cloudstack-version: ${{ matrix.cloudstack-version }}
@@ -78,8 +78,8 @@ jobs:
fail-fast: false
matrix:
terraform-version:
- '1.8.*'
- '1.9.*'
- '1.11.*'
- '1.12.*'
cloudstack-version: ${{ fromJson(needs.prepare-matrix.outputs.cloudstack-versions) }}

acceptance-opentofu:
@@ -93,7 +93,7 @@ jobs:
with:
go-version-file: 'go.mod'
- name: Configure Cloudstack v${{ matrix.cloudstack-version }}
uses: ./.github/workflows/setup-cloudstack
uses: ./.github/actions/setup-cloudstack
id: setup-cloudstack
with:
cloudstack-version: ${{ matrix.cloudstack-version }}
@@ -116,8 +116,8 @@ jobs:
fail-fast: false
matrix:
opentofu-version:
- '1.6.*'
- '1.7.*'
- '1.8.*'
- '1.9.*'
cloudstack-version: ${{ fromJson(needs.prepare-matrix.outputs.cloudstack-versions) }}

all-jobs-passed: # Will succeed if it is skipped