Skip to content

Commit cae4aa5

Browse files
gerrod3dralley
authored andcommitted
Update CI
[noissue]
1 parent 64e55c2 commit cae4aa5

File tree

19 files changed

+167
-54
lines changed

19 files changed

+167
-54
lines changed

.ci/ansible/Containerfile.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ RUN pip3 install \
2727
{{ " " }}"{{ item.source }}"
2828
{%- endfor %}
2929

30-
RUN mkdir -p /etc/nginx/pulp/
30+
USER pulp:pulp
31+
RUN PULP_STATIC_ROOT=/var/lib/operator/static/ PULP_CONTENT_ORIGIN=localhost \
32+
/usr/local/bin/pulpcore-manager collectstatic --clear --noinput --link
33+
USER root:root
34+
3135
{% for item in plugins %}
3236
RUN export plugin_path="$(pip3 show {{ item.name }} | sed -n -e 's/Location: //p')/{{ item.name }}" && \
3337
ln $plugin_path/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ item.name }}.conf || true

.ci/ansible/settings.py.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ TOKEN_SIGNATURE_ALGORITHM = "ES256"
88
CACHE_ENABLED = True
99
REDIS_HOST = "localhost"
1010
REDIS_PORT = 6379
11+
ANALYTICS = False
1112

1213
{% if api_root is defined %}
1314
API_ROOT = {{ api_root | repr }}
@@ -19,6 +20,12 @@ API_ROOT = {{ api_root | repr }}
1920
{% endfor %}
2021
{% endif %}
2122

23+
{% if pulp_scenario_settings is defined and pulp_scenario_settings %}
24+
{% for key, value in pulp_scenario_settings.items() %}
25+
{{ key | upper }} = {{ value | repr }}
26+
{% endfor %}
27+
{% endif %}
28+
2229
{% if stream_test | default(false) -%}
2330
REDIRECT_TO_OBJECT_STORAGE = False
2431
DEFAULT_FILE_STORAGE = "pulpcore.app.models.storage.PulpSFTPStorage"

.ci/ansible/start_container.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
community.crypto.openssh_keypair:
2020
path: ssh/id_ed25519
2121
type: ed25519
22+
owner: 700 # pulp in the container
23+
become: true
2224
when: stream_test | default(false)
2325

2426
- name: "Generate Pulp Settings"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# WARNING: DO NOT EDIT!
2+
#
3+
# This file was generated by plugin_template, and is managed by it. Please use
4+
# './plugin-template --github pulp_python' to update this file.
5+
#
6+
# For more info visit https://github.com/pulp/plugin_template
7+
8+
from packaging.requirements import Requirement
9+
10+
11+
# We install these from source, but it would be really handy if we could test pulpcore
12+
# compatibility that way too.
13+
EXCEPTIONS = [
14+
"pulpcore",
15+
]
16+
17+
18+
def main():
19+
"""Calculate the lower bound of dependencies where possible."""
20+
with open("requirements.txt") as req_file:
21+
for line in req_file:
22+
try:
23+
requirement = Requirement(line)
24+
except ValueError:
25+
print(line.strip())
26+
else:
27+
if requirement.name.replace("-", "_") in EXCEPTIONS:
28+
print(line.strip())
29+
else:
30+
for spec in requirement.specifier:
31+
if spec.operator == ">=":
32+
min_version = str(spec)[2:]
33+
print(f"{requirement.name}=={min_version}")
34+
break
35+
else:
36+
print(line.strip())
37+
38+
39+
if __name__ == "__main__":
40+
main()

.ci/scripts/update_ci_branches.py

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
1+
# WARNING: DO NOT EDIT!
2+
#
3+
# This file was generated by plugin_template, and is managed by it. Please use
4+
# './plugin-template --github pulp_python' to update this file.
5+
#
6+
# For more info visit https://github.com/pulp/plugin_template
7+
18
import os
2-
import re
39
import sys
410
import requests
5-
from packaging.version import Version
6-
from git import Repo
7-
8-
try:
9-
initial_branch = sys.argv[1]
10-
except IndexError:
11-
initial_branch = None
1211

13-
repo = Repo(os.getcwd())
14-
heads = repo.git.ls_remote("--heads", "https://github.com/pulp/pulp_python.git").split("\n")
15-
branches = [h.split("/")[-1] for h in heads if re.search(r"^([0-9]+)\.([0-9]+)$", h.split("/")[-1])]
16-
branches.sort(key=lambda ver: Version(ver))
12+
branches = sys.argv[1:]
1713

1814
headers = {
1915
"Authorization": f"Bearer {os.environ['GITHUB_TOKEN']}",
2016
"Accept": "application/vnd.github.v3+json",
2117
}
2218

23-
if not initial_branch or initial_branch not in branches:
24-
exit("Initial branch not found")
25-
else:
26-
starting = branches.index(initial_branch)
27-
2819
github_api = "https://api.github.com"
2920
workflow_path = "/actions/workflows/update_ci.yml/dispatches"
3021
url = f"{github_api}/repos/pulp/pulp_python{workflow_path}"
3122

32-
for branch in branches[starting:]:
23+
for branch in branches:
3324
print(f"Updating {branch}")
3425
requests.post(url, headers=headers, json={"ref": branch})

.github/template_gitref

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2021.08.26-168-g5c80b54
1+
2021.08.26-190-ge8465b5

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,12 @@ jobs:
9393
- TEST: docs
9494
- TEST: azure
9595
- TEST: s3
96+
- TEST: lowerbounds
9697
outputs:
9798
deprecations-pulp: ${{ steps.deprecations.outputs.deprecations-pulp }}
9899
deprecations-azure: ${{ steps.deprecations.outputs.deprecations-azure }}
99100
deprecations-s3: ${{ steps.deprecations.outputs.deprecations-s3 }}
101+
deprecations-lowerbounds: ${{ steps.deprecations.outputs.deprecations-lowerbounds }}
100102

101103
steps:
102104
- uses: actions/checkout@v3
@@ -190,7 +192,7 @@ jobs:
190192

191193
- name: Extract Deprecations from Logs
192194
id: deprecations
193-
run: echo "::set-output name=deprecations-${{ matrix.env.TEST }}::$(docker logs pulp 2>&1 | grep -i pulpcore.deprecation | base64 -w 0)"
195+
run: echo deprecations-${{ matrix.env.TEST }}=$(docker logs pulp 2>&1 | grep -i pulpcore.deprecation | base64 -w 0) >> $GITHUB_OUTPUT
194196

195197
- name: Logs
196198
if: always()
@@ -213,11 +215,13 @@ jobs:
213215
test -z "${{ needs.test.outputs.deprecations-pulp }}"
214216
test -z "${{ needs.test.outputs.deprecations-azure }}"
215217
test -z "${{ needs.test.outputs.deprecations-s3 }}"
218+
test -z "${{ needs.test.outputs.deprecations-lowerbounds }}"
216219
- name: Print deprecations
217220
if: failure()
218221
run: |
219222
echo "${{ needs.test.outputs.deprecations-pulp }}" | base64 -d
220223
echo "${{ needs.test.outputs.deprecations-azure }}" | base64 -d
221224
echo "${{ needs.test.outputs.deprecations-s3 }}" | base64 -d
225+
echo "${{ needs.test.outputs.deprecations-lowerbounds }}" | base64 -d
222226
223227

.github/workflows/nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- TEST: azure
2828
- TEST: s3
2929
- TEST: generate-bindings
30+
- TEST: lowerbounds
3031

3132
steps:
3233
- uses: actions/checkout@v3

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Install python dependencies
4444
run: |
4545
echo ::group::PYDEPS
46-
pip install bandersnatch bump2version gitpython python-redmine towncrier==19.9.0 wheel
46+
pip install packaging~=21.3 bandersnatch bump2version gitpython python-redmine towncrier==19.9.0 wheel
4747
echo ::endgroup::
4848
4949
- name: Configure Git with pulpbot name and email
@@ -85,6 +85,7 @@ jobs:
8585
- TEST: azure
8686
- TEST: s3
8787
- TEST: generate-bindings
88+
- TEST: lowerbounds
8889

8990
steps:
9091
- uses: actions/download-artifact@v3
@@ -292,7 +293,7 @@ jobs:
292293
- name: Install python dependencies
293294
run: |
294295
echo ::group::PYDEPS
295-
pip install gitpython python-redmine requests packaging tweepy
296+
pip install gitpython python-redmine requests packaging~=21.3 tweepy
296297
echo ::endgroup::
297298
298299
- name: Push branch and tag to GitHub

.github/workflows/scripts/before_install.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ if [ -n "$PULP_OPENAPI_GENERATOR_PR_NUMBER" ]; then
9393
fi
9494

9595

96+
git clone --depth=1 https://github.com/pulp/pulp-cli.git
97+
if [ -n "$PULP_CLI_PR_NUMBER" ]; then
98+
cd pulp-cli
99+
git fetch origin pull/$PULP_CLI_PR_NUMBER/head:$PULP_CLI_PR_NUMBER
100+
git checkout $PULP_CLI_PR_NUMBER
101+
cd ..
102+
fi
103+
104+
cd pulp-cli
105+
pip install .
106+
pulp config create --base-url https://pulp --location tests/cli.toml
107+
mkdir ~/.config/pulp
108+
cp tests/cli.toml ~/.config/pulp/cli.toml
109+
cd ..
110+
96111

97112
git clone --depth=1 https://github.com/pulp/pulpcore.git --branch main
98113

@@ -117,12 +132,14 @@ then
117132
echo "Failed to install amazon.aws"
118133
exit $s
119134
fi
120-
# Patch DJANGO_ALLOW_ASYNC_UNSAFE out of the pulpcore tasking_system
121-
# Don't let it fail. Be opportunistic.
122-
sed -i -e '/DJANGO_ALLOW_ASYNC_UNSAFE/d' pulpcore/pulpcore/tasking/entrypoint.py || true
123135

124136
cd pulp_python
125137

138+
if [[ "$TEST" = "lowerbounds" ]]; then
139+
python3 .ci/scripts/calc_deps_lowerbounds.py > lowerbounds_requirements.txt
140+
mv lowerbounds_requirements.txt requirements.txt
141+
fi
142+
126143
if [ -f $POST_BEFORE_INSTALL ]; then
127144
source $POST_BEFORE_INSTALL
128145
fi

0 commit comments

Comments
 (0)