-
Notifications
You must be signed in to change notification settings - Fork 24
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
ppc64le core-bpf testing and PR testing #1448
Changes from all commits
c0c3ba0
374caac
b1025af
389b3e1
57c15e8
8b6567b
8d5022f
061c960
bb44aa3
b07e589
2cc5c2e
6ddc1f7
8b64483
0259abc
829a978
af11518
86b3670
d441b5b
35e503f
a3b1afa
ac25909
bed285b
8e2594a
98ba030
d9aac63
c8131b0
b05e842
ad2096f
113b2cb
55971b0
60d382a
5d7da31
b7ac88b
ec104e6
fdf4225
2eb6aa1
47381d2
4e981e6
99b9913
33020f0
5aca66c
ccbdfc6
abff0bb
5bb5308
25dc68b
55bd76a
86b4032
90eedf1
b29ddfe
9cc4289
c406b5a
4618253
050b8eb
2bff037
6f685f1
c2b1421
2631830
c81c566
85a34c4
26ab212
44f93f2
b8b1b67
dc521ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Setup VM Credentials | ||
description: | | ||
This action will setup the runner with the necessary credentials to create and | ||
interact with VMs | ||
|
||
inputs: | ||
gcp-ssh-key: | ||
description: | ||
The SSH private key to use for GCP | ||
gcp-ssh-key-pub: | ||
description: | ||
The SSH public key to use for GCP | ||
s390x-ssh-key: | ||
description: | ||
The SSH private key to use for s390x | ||
ppc64le-ssh-key: | ||
description: | ||
The SSH private key to use for ppc64le | ||
ppc64le-ssh-key-pub: | ||
description: | ||
The SSH public key to use for ppc64le | ||
s390x-key: | ||
description: | ||
The API key to use for s390x | ||
ppc64le-key: | ||
description: | ||
The API key to use for ppc64le | ||
redhat-username: | ||
description: | ||
The username for registering redhat servers | ||
redhat-password: | ||
description: | ||
The password for registering redhat servers | ||
vm-type: | ||
description: | ||
The type of VMs to be created | ||
job-tag: | ||
description: | ||
Optional job tag to add to the ID | ||
runs: | ||
using: composite | ||
steps: | ||
- shell: bash | ||
run: | | ||
mkdir -p /tmp/secret/stackrox-collector-e2e-tests | ||
cp "$GOOGLE_APPLICATION_CREDENTIALS" /tmp/secret/stackrox-collector-e2e-tests/GOOGLE_CREDENTIALS_COLLECTOR_SVC_ACCT | ||
|
||
mkdir -p "$HOME/.ssh" | ||
chmod 0700 "$HOME/.ssh" | ||
|
||
function copy_secret_to_file() { | ||
local secret="$1" | ||
local destination="$2" | ||
local perms="$3" | ||
|
||
echo "$secret" > "$destination" | ||
chmod "$perms" "$destination" | ||
} | ||
|
||
copy_secret_to_file "${{ inputs.gcp-ssh-key }}" "$HOME/.ssh/google_compute_engine" 0600 | ||
copy_secret_to_file "${{ inputs.gcp-ssh-key-pub }}" "$HOME/.ssh/google_compute_engine.pub" 0600 | ||
copy_secret_to_file "${{ inputs.s390x-ssh-key }}" "$HOME/.ssh/acs-s390x-rsa.prv" 0600 | ||
copy_secret_to_file "${{ inputs.ppc64le-ssh-key }}" "$HOME/.ssh/acs-ppc64le-rsa.prv" 0600 | ||
|
||
ls -lah $HOME/.ssh/ | ||
|
||
- shell: bash | ||
run: | | ||
# | ||
# JOB_ID is a little odd in that it needs to be unique per vm_type, | ||
# but GHA's run_id is only unique per job. Appending the vm_type | ||
# makes it fit our requirements... | ||
# | ||
# but wait, there's more | ||
# | ||
# the job id is used both as part of a GCP instance name and label, but | ||
# also as a group name in ansible, which means it has some restrictions: | ||
# | ||
# - must be alpha-numeric | ||
# - must not contain underscores (because of GCP) | ||
# - must not contain hyphens (because of ansible) | ||
# | ||
# vm_type may contain hyphens, so the id is normalized below | ||
# | ||
JOB_ID="${{ github.run_id }}${{ inputs.vm-type }}${{ inputs.job-tag }}" | ||
NORM_JOB_ID="${JOB_ID//-/}" | ||
|
||
{ | ||
echo "IBM_CLOUD_POWER_API_KEY=${{ inputs.ppc64le-key }}" | ||
echo "IBM_CLOUD_S390X_API_KEY=${{ inputs.s390x-key }}" | ||
echo "IBM_CLOUD_POWER_SSH_PUBLIC_KEY=${{ inputs.ppc64le-ssh-key-pub }}" | ||
echo "JOB_ID=${NORM_JOB_ID}" | ||
echo "BUILD_TYPE=ci" | ||
echo "VM_TYPE=${{ inputs.vm-type }}" | ||
echo "REDHAT_USERNAME=${{ inputs.redhat-username }}" | ||
echo "REDHAT_PASSWORD=${{ inputs.redhat-password }}" | ||
} >> "$GITHUB_ENV" | ||
|
||
- shell: bash | ||
run: | | ||
python -m pip install -r "${{ github.workspace }}/ansible/requirements.txt" | ||
ansible-galaxy collection install -r "${{ github.workspace }}/ansible/requirements.yml" | ||
ansible-galaxy collection install -r "${{ github.workspace }}/ansible/ansible-collections.yml" | ||
|
||
# Added workaround for ssh connection issue with power vm from ubuntu machine. | ||
# Changing mtu works in resolving the issue | ||
- shell: bash | ||
run: sudo ifconfig eth0 mtu 1000 up | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,12 @@ on: | |
outputs: | ||
collector-builder-tag: | ||
description: The builder tag used by the build | ||
value: ${{ jobs.build-builder-image.outputs.collector-builder-tag || 'master' }} | ||
value: ${{ jobs.build-builder-image.outputs.collector-builder-tag || '3.16.x-195-g8f32e71fad' }} | ||
|
||
env: | ||
COLLECTOR_TAG: ${{ inputs.collector-tag }} | ||
DEFAULT_BUILDER_TAG: 3.16.x-195-g8f32e71fad | ||
ANSIBLE_CONFIG: ${{ github.workspace }}/ansible/ansible.cfg | ||
|
||
jobs: | ||
builder-needs-rebuilding: | ||
|
@@ -59,6 +60,7 @@ jobs: | |
|
||
env: | ||
PLATFORM: linux/${{ matrix.arch }} | ||
BUILD_TYPE: ci | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -71,6 +73,35 @@ jobs: | |
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- uses: 'google-github-actions/auth@v1' | ||
with: | ||
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS_COLLECTOR_SVC_ACCT }}' | ||
|
||
- uses: 'google-github-actions/setup-gcloud@v1' | ||
|
||
- uses: ./.github/actions/setup-vm-creds | ||
with: | ||
gcp-ssh-key: ${{ secrets.GCP_SSH_KEY }} | ||
gcp-ssh-key-pub: ${{ secrets.GCP_SSH_KEY_PUB }} | ||
s390x-ssh-key: ${{ secrets.IBM_CLOUD_S390X_SSH_PRIVATE_KEY }} | ||
ppc64le-ssh-key: ${{ secrets.IBM_CLOUD_POWER_SSH_PRIVATE_KEY }} | ||
ppc64le-ssh-key-pub: ${{ secrets.IBM_CLOUD_POWER_SSH_PUBLIC_KEY }} | ||
s390x-key: ${{ secrets.IBM_CLOUD_S390x_API_KEY }} | ||
ppc64le-key: ${{ secrets.IBM_CLOUD_POWER_API_KEY }} | ||
redhat-username: ${{ secrets.REDHAT_USERNAME }} | ||
redhat-password: ${{ secrets.REDHAT_PASSWORD }} | ||
vm-type: all | ||
job-tag: builder | ||
|
||
- name: Create Build VMs | ||
if: matrix.arch == 's390x' | ||
run: | | ||
make -C "${{ github.workspace }}/ansible" create-build-vms | ||
|
||
- name: Define builder tag | ||
id: builder-tag | ||
run: | | ||
|
@@ -84,29 +115,27 @@ jobs: | |
echo "COLLECTOR_BUILDER_TAG=${COLLECTOR_BUILDER_TAG}" >> "$GITHUB_ENV" | ||
echo "collector-builder-tag=${COLLECTOR_BUILDER_TAG}" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Create Ansible Vars (inc. secrets) | ||
- name: Create ansible vars | ||
run: | | ||
{ | ||
echo "---" | ||
echo "stackrox_io_username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }}" | ||
echo "stackrox_io_password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }}" | ||
echo "rhacs_eng_username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }}" | ||
echo "rhacs_eng_password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }}" | ||
echo "collector_git_ref: ${{ github.ref }}" | ||
echo "collector_git_sha: ${{ github.sha }}" | ||
echo "collector_builder_tag: ${{ env.COLLECTOR_BUILDER_TAG }}" | ||
} > ${{ github.workspace }}/ansible/secrets.yml | ||
|
||
if [[ "${RUNNER_DEBUG}" == "1" ]]; then | ||
echo "ANSIBLE_STDOUT_CALLBACK=debug" >> "${GITHUB_ENV}" | ||
fi | ||
|
||
- name: Build images | ||
if: | | ||
github.event_name == 'push' || | ||
matrix.arch == 'amd64' || | ||
contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') | ||
(contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') && matrix.arch != 's390x') | ||
timeout-minutes: 480 | ||
run: | | ||
ansible-galaxy install -r ansible/requirements.yml | ||
|
||
ansible-playbook \ | ||
--connection local \ | ||
-i localhost, \ | ||
|
@@ -115,6 +144,24 @@ jobs: | |
-e @'${{ github.workspace }}/ansible/secrets.yml' \ | ||
ansible/ci-build-builder.yml | ||
|
||
- name: Build s390x images | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels a bit weird, is it easier to build s390x images in a separate step, not as part of the previous one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now, yeah it's a little simpler, just because we can force the previous step to use localhost only, but this step will use the entire inventory (which is only one VM at the moment) When I implement full multi-arch native builds I'll hopefully combine these steps |
||
if: | | ||
github.event_name == 'push' || | ||
(contains(github.event.pull_request.labels.*.name, 'run-multiarch-builds') && matrix.arch == 's390x') | ||
timeout-minutes: 480 | ||
run: | | ||
ansible-playbook \ | ||
-i ansible/ci \ | ||
-e build_hosts='job_id_${{ env.JOB_ID }}' \ | ||
-e arch='${{ matrix.arch }}' \ | ||
-e @'${{ github.workspace }}/ansible/secrets.yml' \ | ||
ansible/ci-build-builder.yml | ||
|
||
- name: Destroy VMs | ||
if: always() && matrix.arch == 's390x' | ||
run: | | ||
make -C ansible destroy-vms | ||
|
||
create-multiarch-manifest: | ||
needs: | ||
- build-builder-image | ||
|
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.
What was this image exactly? And would it be dropped before merging?
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.
This was taken from mauro's original vanilla PR and will be dropped before merging.