forked from pulp/pulp-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[noissue]
- Loading branch information
Showing
62 changed files
with
3,526 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM {{ ci_base | default(pulp_default_container) }} | ||
|
||
# Add source directories to container | ||
{% for item in plugins %} | ||
ADD ./{{ item.name }} ./{{ item.name }} | ||
{% endfor %} | ||
|
||
# Install python packages | ||
# S3 botocore needs to be patched to handle responses from minio during 0-byte uploads | ||
# Hacking botocore (https://github.com/boto/botocore/pull/1990) | ||
|
||
RUN pip3 install | ||
{%- if s3_test | default(false) -%} | ||
{{ " " }}git+https://github.com/gerrod3/botocore.git@fix-100-continue | ||
{%- endif -%} | ||
{%- for item in plugins -%} | ||
{{ " " }}{{ item.source }} | ||
{%- if item.lowerbounds | default(false) -%} | ||
{{ " " }}-c ./{{ item.name }}/lowerbounds_constraints.txt | ||
{%- endif -%} | ||
{%- if item.ci_requirements | default(false) -%} | ||
{{ " " }}-r ./{{ item.name }}/ci_requirements.txt | ||
{%- endif -%} | ||
{%- endfor %} | ||
|
||
{% if pulp_env is defined and pulp_env %} | ||
{% for key, value in pulp_env.items() %} | ||
ENV {{ key | upper }}={{ value }} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
{% if pulp_scenario_env is defined and pulp_scenario_env %} | ||
{% for key, value in pulp_scenario_env.items() %} | ||
ENV {{ key | upper }}={{ value }} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
USER pulp:pulp | ||
RUN PULP_STATIC_ROOT=/var/lib/operator/static/ PULP_CONTENT_ORIGIN=localhost \ | ||
/usr/local/bin/pulpcore-manager collectstatic --clear --noinput --link | ||
USER root:root | ||
|
||
{% for item in plugins %} | ||
RUN export plugin_path="$(pip3 show {{ item.name }} | sed -n -e 's/Location: //p')/{{ item.name }}" && \ | ||
ln $plugin_path/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ item.name }}.conf || true | ||
{% endfor %} | ||
|
||
ENTRYPOINT ["/init"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[defaults] | ||
inventory = inventory.yaml | ||
filter_plugins = filter | ||
retry_files_enabled = False | ||
transport = local | ||
nocows = 1 | ||
stdout_callback = yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Ansible playbook to create the pulp service containers image | ||
--- | ||
- hosts: localhost | ||
gather_facts: false | ||
vars_files: | ||
- vars/main.yaml | ||
tasks: | ||
- name: "Generate Containerfile from template" | ||
template: | ||
src: Containerfile.j2 | ||
dest: Containerfile | ||
|
||
- name: "Build pulp image" | ||
# We build from the ../.. (parent dir of pulpcore git repo) Docker build | ||
# "context" so that repos like pulp-smash are accessible to Docker | ||
# build. So that PR branches can be used via relative paths. | ||
# | ||
# We default to using the docker build / podman buildah cache, for | ||
# 1-off-builds and CI purposes (which has no cache across CI runs.) | ||
# Run build.yaml with -e cache=false if your builds are using outdated | ||
# layers. | ||
command: "docker build --network host --no-cache={{ not cache | default(true) | bool }} -t {{ image.name }}:{{ image.tag }} -f {{ playbook_dir }}/Containerfile ../../.." | ||
|
||
- name: "Clean image cache" | ||
docker_prune: | ||
images : true | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from __future__ import absolute_import, division, print_function | ||
from packaging.version import parse as parse_version | ||
|
||
__metaclass__ = type | ||
|
||
|
||
ANSIBLE_METADATA = { | ||
"metadata_version": "1.1", | ||
"status": ["preview"], | ||
"supported_by": "community", | ||
} | ||
|
||
|
||
def _repr_filter(value): | ||
return repr(value) | ||
|
||
|
||
def _canonical_semver_filter(value): | ||
return str(parse_version(value)) | ||
|
||
|
||
# ---- Ansible filters ---- | ||
class FilterModule(object): | ||
"""Repr filter.""" | ||
|
||
def filters(self): | ||
"""Filter associations.""" | ||
return { | ||
"repr": _repr_filter, | ||
"canonical_semver": _canonical_semver_filter, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
all: | ||
children: | ||
containers: | ||
hosts: | ||
pulp: | ||
pulp-fixtures: | ||
minio: | ||
ci-sftp: | ||
vars: | ||
ansible_connection: docker | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
CONTENT_ORIGIN = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}" | ||
ANSIBLE_API_HOSTNAME = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}" | ||
ANSIBLE_CONTENT_HOSTNAME = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}/pulp/content" | ||
PRIVATE_KEY_PATH = "/etc/pulp/certs/token_private_key.pem" | ||
PUBLIC_KEY_PATH = "/etc/pulp/certs/token_public_key.pem" | ||
TOKEN_SERVER = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}/token/" | ||
TOKEN_SIGNATURE_ALGORITHM = "ES256" | ||
CACHE_ENABLED = True | ||
REDIS_HOST = "localhost" | ||
REDIS_PORT = 6379 | ||
ANALYTICS = False | ||
|
||
{% if api_root is defined %} | ||
API_ROOT = {{ api_root | repr }} | ||
{% endif %} | ||
|
||
{% if pulp_settings %} | ||
{% for key, value in pulp_settings.items() %} | ||
{{ key | upper }} = {{ value | repr }} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
{% if pulp_scenario_settings is defined and pulp_scenario_settings %} | ||
{% for key, value in pulp_scenario_settings.items() %} | ||
{{ key | upper }} = {{ value | repr }} | ||
{% endfor %} | ||
{% endif %} | ||
|
||
{% if s3_test | default(false) %} | ||
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" | ||
MEDIA_ROOT = "" | ||
AWS_ACCESS_KEY_ID = "{{ minio_access_key }}" | ||
AWS_SECRET_ACCESS_KEY = "{{ minio_secret_key }}" | ||
AWS_S3_REGION_NAME = "eu-central-1" | ||
AWS_S3_ADDRESSING_STYLE = "path" | ||
S3_USE_SIGV4 = True | ||
AWS_S3_SIGNATURE_VERSION = "s3v4" | ||
AWS_STORAGE_BUCKET_NAME = "pulp3" | ||
AWS_S3_ENDPOINT_URL = "http://minio:9000" | ||
AWS_DEFAULT_ACL = "@none None" | ||
{% endif %} | ||
|
||
{% if azure_test | default(false) %} | ||
DEFAULT_FILE_STORAGE = "storages.backends.azure_storage.AzureStorage" | ||
MEDIA_ROOT = "" | ||
AZURE_ACCOUNT_KEY = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" | ||
AZURE_ACCOUNT_NAME = "devstoreaccount1" | ||
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;' | ||
{% endif %} | ||
|
||
{% if gcp_test | default(false) %} | ||
DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" | ||
MEDIA_ROOT = "" | ||
GS_BUCKET_NAME = "gcppulp" | ||
GS_CUSTOM_ENDPOINT = "http://ci-gcp:4443" | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"pulp": { | ||
"auth": [ | ||
"admin", | ||
"password" | ||
], | ||
"selinux enabled": false, | ||
"version": "3", | ||
"aiohttp_fixtures_origin": "127.0.0.1" | ||
}, | ||
"hosts": [ | ||
{ | ||
"hostname": "pulp", | ||
"roles": { | ||
"api": { | ||
"port": 443, | ||
"scheme": "https", | ||
"service": "nginx" | ||
}, | ||
"content": { | ||
"port": 443, | ||
"scheme": "https", | ||
"service": "pulp_content_app" | ||
}, | ||
"pulp resource manager": {}, | ||
"pulp workers": {}, | ||
"redis": {}, | ||
"shell": { | ||
"transport": "local" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Ansible playbook to start the pulp service container and its supporting services | ||
--- | ||
- hosts: localhost | ||
gather_facts: false | ||
vars_files: | ||
- vars/main.yaml | ||
tasks: | ||
- name: "Create Settings Directories" | ||
file: | ||
path: "{{ item }}" | ||
state: directory | ||
mode: "0755" | ||
loop: | ||
- settings | ||
- ssh | ||
- ~/.config/pulp_smash | ||
|
||
- name: "Generate Pulp Settings" | ||
template: | ||
src: settings.py.j2 | ||
dest: settings/settings.py | ||
|
||
- name: "Configure pulp-smash" | ||
copy: | ||
src: smash-config.json | ||
dest: ~/.config/pulp_smash/settings.json | ||
|
||
- name: "Setup docker networking" | ||
docker_network: | ||
name: pulp_ci_bridge | ||
|
||
- name: "Start Service Containers" | ||
docker_container: | ||
name: "{{ item.name }}" | ||
image: "{{ item.image }}" | ||
auto_remove: true | ||
recreate: true | ||
privileged: true | ||
networks: | ||
- name: pulp_ci_bridge | ||
aliases: "{{ item.name }}" | ||
volumes: "{{ item.volumes | default(omit) }}" | ||
env: "{{ item.env | default(omit) }}" | ||
command: "{{ item.command | default(omit) }}" | ||
state: started | ||
loop: "{{ services | default([]) }}" | ||
|
||
- name: "Retrieve Docker Network Info" | ||
docker_network_info: | ||
name: pulp_ci_bridge | ||
register: pulp_ci_bridge_info | ||
|
||
- name: "Update /etc/hosts" | ||
lineinfile: | ||
path: /etc/hosts | ||
regexp: "\\s{{ item.value.Name }}\\s*$" | ||
line: "{{ item.value.IPv4Address | ipaddr('address') }}\t{{ item.value.Name }}" | ||
loop: "{{ pulp_ci_bridge_info.network.Containers | dict2items }}" | ||
become: true | ||
|
||
- name: "Create Pulp Bucket" | ||
amazon.aws.s3_bucket: | ||
aws_access_key: "{{ minio_access_key }}" | ||
aws_secret_key: "{{ minio_secret_key }}" | ||
s3_url: "http://minio:9000" | ||
region: eu-central-1 | ||
name: pulp3 | ||
state: present | ||
when: s3_test | default(false) | ||
|
||
- block: | ||
- name: "Wait for Pulp" | ||
uri: | ||
url: "http://pulp{{ lookup('env', 'PULP_API_ROOT') | default('\/pulp\/', True) }}api/v3/status/" | ||
follow_redirects: all | ||
validate_certs: no | ||
register: result | ||
until: result.status == 200 | ||
retries: 12 | ||
delay: 5 | ||
rescue: | ||
- name: "Output pulp container log" | ||
command: "docker logs pulp" | ||
failed_when: true | ||
|
||
- name: "Check version of component being tested" | ||
assert: | ||
that: | ||
- (result.json.versions | items2dict(key_name="component", value_name="version"))[item.app_label] | canonical_semver == (component_version | canonical_semver) | ||
fail_msg: | | ||
Component {{ item.app_label }} was expected to be installed in version {{ component_version }}. | ||
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[item.app_label] }}. | ||
loop: "{{ 'plugins' | ansible.builtin.extract(lookup('ansible.builtin.file', '../../template_config.yml') | from_yaml) }}" | ||
|
||
- name: "Set pulp password in .netrc" | ||
copy: | ||
dest: "~/.netrc" | ||
content: | | ||
machine pulp | ||
login admin | ||
password password | ||
- hosts: pulp | ||
gather_facts: false | ||
tasks: | ||
- name: "Set pulp admin password" | ||
command: | ||
cmd: "pulpcore-manager reset-admin-password --password password" | ||
... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"default_options": [ | ||
"--ignore-stdin", | ||
"--pretty=format", | ||
"--traceback" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bump2version | ||
gitpython | ||
towncrier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# WARNING: DO NOT EDIT! | ||
# | ||
# This file was generated by plugin_template, and is managed by it. Please use | ||
# './plugin-template --github pulp_docs' to update this file. | ||
# | ||
# For more info visit https://github.com/pulp/plugin_template | ||
|
||
from packaging.requirements import Requirement | ||
|
||
|
||
def main(): | ||
"""Calculate the lower bound of dependencies where possible.""" | ||
with open("requirements.txt") as req_file: | ||
for line in req_file: | ||
try: | ||
requirement = Requirement(line) | ||
except ValueError: | ||
print(line.strip()) | ||
else: | ||
for spec in requirement.specifier: | ||
if spec.operator == ">=": | ||
if requirement.name == "pulpcore": | ||
operator = "~=" | ||
else: | ||
operator = "==" | ||
min_version = str(spec)[2:] | ||
print(f"{requirement.name}{operator}{min_version}") | ||
break | ||
else: | ||
print(line.strip()) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.