-
Notifications
You must be signed in to change notification settings - Fork 37
Support site Pulp server for image builds #490
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
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
40d9e1f
replaces system repos with ark repos during ci
wtripp180901 9ef7d69
now uses lookup instead of packer args
wtripp180901 a6e1243
only applies to RL9 for now
wtripp180901 6faf919
refactored ark role, disabled repos at end of build and modified site…
wtripp180901 0bc473c
fixed ood install with disbaled repos + fixed ark CRB typo
wtripp180901 364ec79
fixed eessi install and slurm not loading appliances_mode
wtripp180901 b0558b9
variables renames + more ansible facts in dnf_repos
wtripp180901 3131bd6
bump images
wtripp180901 1be9c6b
added review comment
wtripp180901 b7670e9
moved config into builder and .stackhpc
wtripp180901 3de36cf
pull
wtripp180901 2230bb8
overriding openhpc extra repos in common
wtripp180901 9723782
testing builds with leafcloud pulp
wtripp180901 127b792
pulp integration
wtripp180901 5b60770
merge conflicts
wtripp180901 0d8a440
typos
wtripp180901 90a33fa
missed merge conflict
wtripp180901 eaa3680
moved pulp port into url
wtripp180901 9a75656
fixed port not getting added in adhoc
wtripp180901 741872a
bump
wtripp180901 39cf556
cleaned up disabling repos + now optional
wtripp180901 25644c3
typo
wtripp180901 fef3d56
repos now timestamped + synced at bootstrap
wtripp180901 1c4a511
refactored pulp_site list
wtripp180901 187bc40
added pulp sync adhoc and temporarily moved out of ci
wtripp180901 580b0b3
fixed disabling for ci
wtripp180901 2ed6674
made dnf epel repo more configurable
wtripp180901 d12083a
moved repo enable/disable into fatimage
wtripp180901 59dd169
merge conflicts
wtripp180901 07dc9b7
fixed disable repos task
wtripp180901 3088f83
reverted disable repos task
wtripp180901 c74360b
fatimage with test latest (REVERT LATER)
wtripp180901 67ce24b
refactored pulp deploy and added pulp docs
wtripp180901 c433605
testing image using site pulp
wtripp180901 bda3f7e
Pointed dnf repos back at ark for now + refactor
wtripp180901 d6eabe6
unused var
wtripp180901 f0e48b9
pulp sync now mirrors upstream subpaths
wtripp180901 309bd0b
removed intermediate var
wtripp180901 a2a705c
Merge branch 'main' into feat/pulp-builds
wtripp180901 7d7bc73
bump images
wtripp180901 c162e18
Refactored common repolist
wtripp180901 bda3f0d
Code review doc/comment suggestions
wtripp180901 bc5e26e
docs/groups corrections
wtripp180901 18b220e
moved defaults to CI and updated docs
wtripp180901 9c41725
bump images
wtripp180901 6c74a1e
repos now controlled by groups + possible during configure + guarded …
wtripp180901 2357a73
typo
wtripp180901 bf6f368
bump
wtripp180901 7fe3ca5
docs suggestions
wtripp180901 a3e1258
Merge branch 'main' into feat/pulp-builds
wtripp180901 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,26 @@ | ||
# Usage: ansible-playbook ansible/adhoc/deploy-pulp.yml -e "pulp_server=<pulp server hostname>" | ||
wtripp180901 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Add temporary pulp server host | ||
hosts: localhost | ||
tasks: | ||
- ansible.builtin.add_host: | ||
name: "{{ pulp_server }}" | ||
group: "_pulp_host" | ||
|
||
- name: Install pulp on server and add to config | ||
become: yes | ||
hosts: _pulp_host | ||
wtripp180901 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tasks: | ||
- name: Install pulp | ||
ansible.builtin.include_role: | ||
name: pulp_site | ||
tasks_from: install.yml | ||
public: true | ||
|
||
- name: Print Pulp endpoint | ||
become: no | ||
debug: | ||
msg: | | ||
Server configured, override 'appliances_pulp_url' with | ||
appliances_pulp_url: "http://{{ pulp_server }}:{{ pulp_site_port }}" | ||
in your environments |
This file contains hidden or 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,10 @@ | ||
- hosts: localhost | ||
tasks: | ||
- ansible.builtin.include_role: | ||
name: pulp_site | ||
tasks_from: sync.yml | ||
vars: | ||
pulp_site_target_arch: "x86_64" | ||
pulp_site_target_distribution: "rocky" | ||
pulp_site_target_distribution_version: "9.4" | ||
pulp_site_target_distribution_version_major: "9" |
This file contains hidden or 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
This file contains hidden or 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,8 @@ | ||
- hosts: dnf_repos | ||
become: yes | ||
tasks: | ||
- name: Disable pulp repos | ||
ansible.builtin.include_role: | ||
name: dnf_repos | ||
tasks_from: disable_repos.yml | ||
when: ansible_distribution_major_version == "9" #TODO update role once RL8 config decided |
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,25 +1,23 @@ | ||
dnf_repos_rocky_ark_prefix: https://ark.stackhpc.com/pulp/content/{{ ansible_distribution | lower }}/{{ ansible_distribution_version }} | ||
dnf_repos_rocky_ark_suffix: "{{ ansible_architecture }}/os/{{ dnf_repos_rocky_ark_timestamp }}/" | ||
# most stable from https://github.com/stackhpc/stackhpc-kayobe-config/blob/stackhpc/2024.1/etc/kayobe/pulp-repo-versions.yml | ||
# note that some timestamps can't be used because not all repos have snapshots for them | ||
dnf_repos_rocky_ark_timestamp: 20240816T002610 | ||
dnf_repos_username: slurm-app-ci | ||
dnf_repos_password: "{{ lookup('ansible.builtin.env', 'ARK_PASSWORD') }}" | ||
dnf_repos_pulp_content_url: "{{ appliances_pulp_url }}/pulp/content" | ||
dnf_repos_rocky_prefix: "{{ ansible_distribution | lower }}/{{ ansible_distribution_version }}" | ||
dnf_repos_epel_prefix: "epel/{{ ansible_distribution_major_version }}" | ||
dnf_repos_username: "{{ omit }}" | ||
wtripp180901 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dnf_repos_password: "{{ omit }}" | ||
|
||
# epel installed separately | ||
dnf_repos_repolist: | ||
- file: rocky | ||
name: baseos | ||
base_url: "{{ dnf_repos_rocky_ark_prefix }}/BaseOS/{{ dnf_repos_rocky_ark_suffix }}" | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/BaseOS/{{ ansible_architecture }}/os/{{ appliances_repo_timestamps.baseos[ansible_distribution_version] }}" | ||
- file: rocky | ||
name: appstream | ||
base_url: "{{ dnf_repos_rocky_ark_prefix }}/AppStream/{{ dnf_repos_rocky_ark_suffix }}" | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/AppStream/{{ ansible_architecture }}/os/{{ appliances_repo_timestamps.appstream[ansible_distribution_version] }}" | ||
- file: rocky | ||
name: crb | ||
base_url: "{{ dnf_repos_rocky_ark_prefix }}/CRB/{{ dnf_repos_rocky_ark_suffix }}" | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/CRB/{{ ansible_architecture }}/os/{{ appliances_repo_timestamps.crb[ansible_distribution_version] }}" | ||
- file: rocky-extras | ||
name: extras | ||
base_url: "{{ dnf_repos_rocky_ark_prefix }}/extras/{{ dnf_repos_rocky_ark_suffix }}" | ||
base_url: "{{ dnf_repos_pulp_content_url }}/{{ dnf_repos_rocky_prefix }}/extras/{{ ansible_architecture }}/os/{{ appliances_repo_timestamps.extras[ansible_distribution_version] }}" | ||
|
||
dnf_repos_epel_timestamp: 20240902T080424 | ||
dnf_repos_epel_baseurl: "https://ark.stackhpc.com/pulp/content/epel/{{ ansible_distribution_major_version }}/Everything/{{ ansible_architecture }}/{{ dnf_repos_epel_timestamp }}" | ||
dnf_repos_epel_baseurl: "{{ dnf_repos_pulp_content_url }}/epel/{{ ansible_distribution_major_version }}/Everything/{{ ansible_architecture }}/{{ appliances_repo_timestamps.epel[ansible_distribution_major_version] }}" | ||
dnf_repos_epel_description: "epel" |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 @@ | ||
filter_plugins/__pycache__ |
This file contains hidden or 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,39 @@ | ||
pulp_site_url: "{{ appliances_pulp_url }}" | ||
pulp_site_port: 8080 | ||
pulp_site_username: admin # shouldn't be changed | ||
pulp_site_password: "{{ vault_pulp_admin_password }}" | ||
pulp_site_upstream_content_url: https://ark.stackhpc.com/pulp/content | ||
_pulp_site_rocky_prefix: "{{ pulp_site_target_distribution }}/{{ pulp_site_target_distribution_version }}" | ||
pulp_site_default_upstream_suffix: "{{ pulp_site_target_arch }}/os" | ||
pulp_site_validate_certs: false | ||
pulp_site_install_dir: '/home/rocky/pulp' | ||
pulp_site_selinux_suffix: "{{ ':Z' if ansible_selinux.status == 'enabled' else '' }}" | ||
pulp_site_target_facts: "{{ hostvars[groups['builder'][0]]['ansible_facts'] }}" | ||
pulp_site_target_arch: "{{ pulp_site_target_facts['architecture'] }}" | ||
pulp_site_target_distribution: "{{ pulp_site_target_facts['distribution'] | lower }}" | ||
pulp_site_target_distribution_version: "{{ pulp_site_target_facts['distribution_version'] }}" | ||
pulp_site_target_distribution_version_major: "{{ pulp_site_target_facts['distribution_major_version'] }}" | ||
|
||
pulp_site_rpm_info: | ||
- name: "baseos-{{ pulp_site_target_distribution_version }}-{{ appliances_repo_timestamps.baseos[pulp_site_target_distribution_version] }}" | ||
subpath: "{{ _pulp_site_rocky_prefix }}/BaseOS/{{ pulp_site_default_upstream_suffix }}/{{ appliances_repo_timestamps.baseos[pulp_site_target_distribution_version] }}" | ||
- name: "appstream-{{ pulp_site_target_distribution_version }}-{{ appliances_repo_timestamps.appstream[pulp_site_target_distribution_version] }}" | ||
subpath: "{{ _pulp_site_rocky_prefix }}/AppStream/{{ pulp_site_default_upstream_suffix }}/{{ appliances_repo_timestamps.appstream[pulp_site_target_distribution_version] }}" | ||
- name: "crb-{{ pulp_site_target_distribution_version }}-{{ appliances_repo_timestamps.crb[pulp_site_target_distribution_version] }}" | ||
subpath: "{{ _pulp_site_rocky_prefix }}/{{ 'PowerTools' if pulp_site_target_distribution_version_major == '8' else 'CRB' }}/{{ pulp_site_default_upstream_suffix }}/{{ appliances_repo_timestamps.crb[pulp_site_target_distribution_version] }}" | ||
- name: "extras-{{ pulp_site_target_distribution_version }}-{{ appliances_repo_timestamps.extras[pulp_site_target_distribution_version] }}" | ||
subpath: "{{ _pulp_site_rocky_prefix }}/extras/{{ pulp_site_default_upstream_suffix }}/{{ appliances_repo_timestamps.extras[pulp_site_target_distribution_version] }}" | ||
- name: "epel-{{ pulp_site_target_distribution_version_major }}-{{ appliances_repo_timestamps.epel[pulp_site_target_distribution_version_major] }}" | ||
subpath: "epel/{{ pulp_site_target_distribution_version_major }}/Everything/{{ pulp_site_target_arch }}/{{ appliances_repo_timestamps.epel[pulp_site_target_distribution_version_major] }}" | ||
|
||
pulp_site_rpm_repo_defaults: | ||
remote_username: "{{ pulp_site_upstream_username }}" | ||
remote_password: "{{ pulp_site_upstream_password }}" | ||
policy: on_demand | ||
state: present | ||
|
||
_pulp_site_rpm_info_all: "{{ pulp_site_rpm_info | map('combine', pulp_site_rpm_repo_defaults) }}" | ||
|
||
pulp_site_rpm_repos: "{{ _pulp_site_rpm_info_all | to_rpm_repos(pulp_site_upstream_content_url) }}" | ||
pulp_site_rpm_publications: "{{ _pulp_site_rpm_info_all | to_rpm_pubs }}" | ||
pulp_site_rpm_distributions: "{{ _pulp_site_rpm_info_all | to_rpm_distros }}" |
31 changes: 31 additions & 0 deletions
31
ansible/roles/pulp_site/filter_plugins/pulp-list-filters.py
This file contains hidden or 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 @@ | ||
class FilterModule(object): | ||
def filters(self): | ||
return { | ||
'to_rpm_repos': self.to_rpm_repos, | ||
'to_rpm_pubs': self.to_rpm_pubs, | ||
'to_rpm_distros': self.to_rpm_distros | ||
} | ||
|
||
def to_rpm_repos(self, list, pulp_url): | ||
repo_list = map(lambda x: { | ||
'name': x['name'], | ||
'url': pulp_url+'/'+x['subpath'], | ||
'remote_username': x['remote_username'], | ||
'remote_password': x['remote_password'], | ||
'policy': x['policy'], | ||
'state': x['state'] }, list) | ||
return repo_list | ||
|
||
def to_rpm_pubs(self, list): | ||
pub_list = map(lambda x: { | ||
'repository': x['name'], | ||
'state': x['state'] }, list) | ||
return pub_list | ||
|
||
def to_rpm_distros(self, list): | ||
distro_list = map(lambda x: { | ||
'name': x['name'], | ||
'repository': x['name'], | ||
'base_path': x['subpath'], | ||
'state': x['state'] }, list) | ||
return distro_list |
This file contains hidden or 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,43 @@ | ||
--- | ||
|
||
- name: Install packages | ||
dnf: | ||
name: | ||
- podman | ||
|
||
- name: Create install directories | ||
ansible.builtin.file: | ||
state: directory | ||
path: "{{ pulp_site_install_dir }}/{{ item }}" | ||
loop: | ||
- settings/certs | ||
- pulp_storage | ||
- pgsql | ||
- containers | ||
|
||
- name: Template settings file | ||
ansible.builtin.template: | ||
src: settings.py.j2 | ||
dest: "{{ pulp_site_install_dir }}/settings/settings.py" | ||
|
||
- name: Install pulp podman container | ||
containers.podman.podman_container: | ||
name: pulp | ||
publish: | ||
- "{{ pulp_site_port }}:80" | ||
volume: | ||
- "{{ pulp_site_install_dir }}/settings:/etc/pulp{{ pulp_site_selinux_suffix }}" | ||
- "{{ pulp_site_install_dir }}/pulp_storage:/var/lib/pulp{{ pulp_site_selinux_suffix }}" | ||
- "{{ pulp_site_install_dir }}/pgsql:/var/lib/pgsql{{ pulp_site_selinux_suffix }}" | ||
- "{{ pulp_site_install_dir }}/containers:/var/lib/containers{{ pulp_site_selinux_suffix }}" | ||
device: /dev/fuse | ||
image: docker.io/pulp/pulp:3.68.1 | ||
|
||
- name: Reset admin password once container has initialised | ||
no_log: true | ||
ansible.builtin.shell: | ||
cmd: "podman exec pulp bash -c 'pulpcore-manager reset-admin-password -p {{ pulp_site_password }}'" | ||
register: _admin_reset_output | ||
until: 0 == _admin_reset_output.rc | ||
retries: 6 | ||
delay: 30 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.