Skip to content

Commit

Permalink
Update CI files
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
pulpbot authored and mdellweg committed Jun 19, 2024
1 parent b9cb720 commit 891cde3
Show file tree
Hide file tree
Showing 26 changed files with 260 additions and 280 deletions.
2 changes: 1 addition & 1 deletion .ci/ansible/settings.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ AZURE_CONTAINER = "pulp-test"
AZURE_LOCATION = "pulp3"
AZURE_OVERWRITE_FILES = True
AZURE_URL_EXPIRATION_SECS = 120
AZURE_CONNECTION_STRING = 'DefaultEndpointsProtocol={{ pulp_scheme }};AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint={{ pulp_scheme }}://ci-azurite:10000/devstoreaccount1;'
AZURE_CONNECTION_STRING = 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ci-azurite:10000/devstoreaccount1;'
{% endif %}

{% if gcp_test | default(false) %}
Expand Down
8 changes: 5 additions & 3 deletions .ci/scripts/collect_changes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/env python3
# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
Expand All @@ -8,13 +9,14 @@
import itertools
import os
import re
import tomllib

import toml
from git import GitCommandError, Repo
from packaging.version import parse as parse_version

# Read Towncrier settings
tc_settings = toml.load("pyproject.toml")["tool"]["towncrier"]
with open("pyproject.toml", "rb") as fp:
tc_settings = tomllib.load(fp)["tool"]["towncrier"]

CHANGELOG_FILE = tc_settings.get("filename", "NEWS.rst")
START_STRING = tc_settings.get(
Expand Down Expand Up @@ -79,7 +81,7 @@ def main():
old_length = len(main_changes)

for branch in branches:
print(f"Looking at branch {branch}")
print(f"Looking for './{CHANGELOG_FILE}' at branch {branch}")
try:
changelog = get_changelog(repo, branch)
except GitCommandError:
Expand Down
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-327-g6a0d984
2021.08.26-339-gf0d923e
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
fetch-depth: 1
path: "pulp_maven"
- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"
- name: "Install python dependencies"
Expand All @@ -36,9 +36,10 @@ jobs:
python3 setup.py sdist bdist_wheel --python-tag py3
twine check dist/*
- name: "Upload Package whl"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "plugin_package"
path: "pulp_maven/dist/"
if-no-files-found: "error"
retention-days: 5
overwrite: true
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
fetch-depth: 1

- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
fetch-depth: 0
path: "pulp_maven"
- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"
- name: "Install python dependencies"
Expand Down Expand Up @@ -67,10 +67,11 @@ jobs:
mkdir -p "pulp_maven"
working-directory: "."
- name: "Download Deprecations"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "deprecations"
pattern: "deprecations-*"
path: "pulp_maven"
merge-multiple: true
- name: "Print deprecations"
run: |
cat deprecations-*.txt | sort -u
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fetch-depth: 0
path: "pulp_maven"

- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fetch-depth: 1
path: "pulp_maven"

- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
fetch-depth: 0
path: "pulp_maven"

- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

Expand Down Expand Up @@ -76,12 +76,12 @@ jobs:
fetch-depth: 1
path: "pulp_maven"

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: "plugin_package"
path: "pulp_maven/dist/"

- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

Expand All @@ -96,13 +96,13 @@ jobs:
echo "TEST=${{ matrix.env.TEST }}" >> $GITHUB_ENV
- name: Download built docs
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "docs.tar"
path: "pulp_maven"

- name: Download Python client docs
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "python-client-docs.tar"
path: "pulp_maven"
Expand Down
43 changes: 26 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:
repository: "pulp/pulp-openapi-generator"
path: "pulp-openapi-generator"

- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

- uses: "actions/download-artifact@v3"
- uses: "actions/download-artifact@v4"
with:
name: "plugin_package"
path: "pulp_maven/dist/"
Expand Down Expand Up @@ -88,25 +88,32 @@ jobs:
run: |
.github/workflows/scripts/install_ruby_client.sh
shell: "bash"

- name: "Upload python client packages"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "python-client.tar"
path: "pulp_maven/maven-python-client.tar"
path: |
pulp_maven/maven-python-client.tar
if-no-files-found: "error"
overwrite: true

- name: "Upload python client docs"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "python-client-docs.tar"
path: "pulp_maven/maven-python-client-docs.tar"
path: |
pulp_maven/maven-python-client-docs.tar
if-no-files-found: "error"
overwrite: true
- name: "Upload ruby client packages"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "ruby-client.tar"
path: "pulp_maven/maven-ruby-client.tar"
path: |
pulp_maven/maven-ruby-client.tar
if-no-files-found: "error"
overwrite: true
- name: Build docs
run: |
export DJANGO_SETTINGS_MODULE=pulpcore.app.settings
Expand All @@ -115,10 +122,12 @@ jobs:
tar -cvf docs/docs.tar docs/_build
- name: "Upload built docs"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "docs.tar"
path: "pulp_maven/docs/docs.tar"
if-no-files-found: "error"
overwrite: true

- name: "Logs"
if: always()
Expand All @@ -145,12 +154,12 @@ jobs:
fetch-depth: 1
path: "pulp_maven"

- uses: "actions/download-artifact@v3"
- uses: "actions/download-artifact@v4"
with:
name: "plugin_package"
path: "pulp_maven/dist/"

- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

Expand Down Expand Up @@ -184,7 +193,7 @@ jobs:
path: "pulp_maven"

- name: "Download Python client"
uses: "actions/download-artifact@v3"
uses: "actions/download-artifact@v4"
with:
name: "python-client.tar"
path: "pulp_maven/"
Expand All @@ -193,7 +202,7 @@ jobs:
run: |
tar -xvf maven-python-client.tar
- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

Expand Down Expand Up @@ -227,7 +236,7 @@ jobs:
path: "pulp_maven"

- name: "Download Ruby client"
uses: "actions/download-artifact@v3"
uses: "actions/download-artifact@v4"
with:
name: "ruby-client.tar"
path: "pulp_maven/"
Expand Down Expand Up @@ -263,7 +272,7 @@ jobs:
fetch-depth: 1
path: "pulp_maven"

- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

Expand All @@ -280,13 +289,13 @@ jobs:
SECRETS_CONTEXT: "${{ toJson(secrets) }}"

- name: "Download built docs"
uses: "actions/download-artifact@v3"
uses: "actions/download-artifact@v4"
with:
name: "docs.tar"
path: "pulp_maven/"

- name: "Download Python client docs"
uses: "actions/download-artifact@v3"
uses: "actions/download-artifact@v4"
with:
name: "python-client-docs.tar"
path: "pulp_maven/"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
path: "pulp_maven"
token: ${{ secrets.RELEASE_TOKEN }}

- uses: "actions/setup-python@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/scripts/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ tail -v -n +1 .ci/ansible/Containerfile
cmd_prefix bash -c "echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/nopasswd"
cmd_prefix bash -c "usermod -a -G wheel pulp"

SCENARIOS=("pulp" "performance" "azure" "gcp" "s3" "generate-bindings" "lowerbounds")
if [[ " ${SCENARIOS[*]} " =~ " ${TEST} " ]]; then
# Many functional tests require these
cmd_prefix dnf install -yq lsof which
fi

if [[ "${REDIS_DISABLED:-false}" == true ]]; then
cmd_prefix bash -c "s6-rc -d change redis"
echo "The Redis service was disabled for $TEST"
Expand Down
26 changes: 3 additions & 23 deletions .github/workflows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,12 @@ pulp_scenario_env: {}\
fi

if [ "$TEST" = "azure" ]; then
mkdir -p azurite
cd azurite
openssl req -newkey rsa:2048 -x509 -nodes -keyout azkey.pem -new -out azcert.pem -sha256 -days 365 -addext "subjectAltName=DNS:ci-azurite" -subj "/C=CO/ST=ST/L=LO/O=OR/OU=OU/CN=CN"
sudo cp azcert.pem /usr/local/share/ca-certificates/azcert.crt
sudo dpkg-reconfigure ca-certificates
cd ..
sed -i -e '/^services:/a \
- name: ci-azurite\
image: mcr.microsoft.com/azure-storage/azurite\
volumes:\
- ./azurite:/etc/pulp\
command: "azurite-blob --blobHost 0.0.0.0 --cert /etc/pulp/azcert.pem --key /etc/pulp/azkey.pem"' vars/main.yaml
command: "azurite-blob --blobHost 0.0.0.0"' vars/main.yaml
sed -i -e '$a azure_test: true\
pulp_scenario_settings: null\
pulp_scenario_env: {}\
Expand Down Expand Up @@ -141,31 +135,17 @@ sudo docker cp pulp:/etc/pulp/certs/pulp_webserver.crt /usr/local/share/ca-certi
# Hack: adding pulp CA to certifi.where()
CERTIFI=$(python -c 'import certifi; print(certifi.where())')
cat /usr/local/share/ca-certificates/pulp_webserver.crt | sudo tee -a "$CERTIFI" > /dev/null
if [[ "$TEST" = "azure" ]]; then
cat /usr/local/share/ca-certificates/azcert.crt | sudo tee -a "$CERTIFI" > /dev/null
fi

# Hack: adding pulp CA to default CA file
CERT=$(python -c 'import ssl; print(ssl.get_default_verify_paths().openssl_cafile)')
cat "$CERTIFI" | sudo tee -a "$CERT" > /dev/null
cat /usr/local/share/ca-certificates/pulp_webserver.crt | sudo tee -a "$CERT" > /dev/null

# Updating certs
sudo update-ca-certificates
echo ::endgroup::

# Add our azcert.crt certificate to the container image along with the certificates from certifi
# so that we can use HTTPS with our fake Azure CI. certifi is self-contained and doesn't allow
# extension or modification of the trust store, so we do a weird and hacky thing (above) where we just
# overwrite or append to certifi's trust store behind it's back.
#
# We do this for both the CI host and the CI image.
if [[ "$TEST" = "azure" ]]; then
AZCERTIFI=$(/opt/az/bin/python3 -c 'import certifi; print(certifi.where())')
PULPCERTIFI=$(cmd_prefix python3 -c 'import certifi; print(certifi.where())')
cat /usr/local/share/ca-certificates/azcert.crt >> $AZCERTIFI
cat /usr/local/share/ca-certificates/azcert.crt | cmd_stdin_prefix tee -a "$PULPCERTIFI" > /dev/null
cat /usr/local/share/ca-certificates/azcert.crt | cmd_stdin_prefix tee -a /etc/pki/tls/cert.pem > /dev/null
AZURE_STORAGE_CONNECTION_STRING='DefaultEndpointsProtocol=https;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=https://ci-azurite:10000/devstoreaccount1;'
AZURE_STORAGE_CONNECTION_STRING='DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://ci-azurite:10000/devstoreaccount1;'
az storage container create --name pulp-test --connection-string $AZURE_STORAGE_CONNECTION_STRING
fi

Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/scripts/publish_client_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ RESPONSE="$(curl --write-out '%{http_code}' --silent --output /dev/null "https:/
if [ "$RESPONSE" == "200" ];
then
echo "pulp_maven client $VERSION has already been released. Skipping."
exit
else
twine upload -u __token__ -p "$PYPI_API_TOKEN" \
"dist/pulp_maven_client-$VERSION-py3-none-any.whl" \
"dist/pulp_maven-client-$VERSION.tar.gz"
fi

twine upload -u __token__ -p "$PYPI_API_TOKEN" \
"dist/pulp_maven_client-$VERSION-py3-none-any.whl" \
"dist/pulp_maven-client-$VERSION.tar.gz" \
;
Loading

0 comments on commit 891cde3

Please sign in to comment.