Skip to content

Commit

Permalink
Merge pull request #733 from stackhpc/yoga-ubuntu-build-deps
Browse files Browse the repository at this point in the history
Ubuntu: add base repos to Kolla container image earlier
  • Loading branch information
jovial authored Nov 3, 2023
2 parents e7db159 + 604fa6f commit 910dc74
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
23 changes: 20 additions & 3 deletions etc/kayobe/kolla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,20 @@ base_centos_repo_overrides_post_yum_rocky_list: "{{ stackhpc_rocky_9_repos + sta
base_centos_repo_overrides_post_yum_list: "{{ base_centos_repo_overrides_post_yum_centos_list if kolla_base_distro == 'centos' else base_centos_repo_overrides_post_yum_rocky_list }}"
stackhpc_yum_repos: "{{ stackhpc_centos_stream_repos if kolla_base_distro == 'centos' else stackhpc_rocky_9_repos }}"

# List of repositories for Ubuntu focal.
stackhpc_ubuntu_focal_repos:
# List of base repositories for Ubuntu Focal.
stackhpc_ubuntu_focal_base_repos:
- "deb {{ stackhpc_repo_ubuntu_focal_url }} focal main universe"
- "deb {{ stackhpc_repo_ubuntu_focal_url }} focal-updates main universe"
- "deb {{ stackhpc_repo_ubuntu_focal_url }} focal-backports main universe"
- "deb {{ stackhpc_repo_ubuntu_focal_security_url }} focal-security main universe"

# List of UCA repositories for Ubuntu Focal.
stackhpc_ubuntu_focal_uca_repos:
- "deb {{ stackhpc_repo_ubuntu_cloud_archive_url }} focal-updates/{{ openstack_release }} main"

# List of repositories for Ubuntu Focal.
stackhpc_ubuntu_focal_repos: "{{ stackhpc_ubuntu_focal_base_repos + stackhpc_ubuntu_focal_uca_repos }}"

# Whether to revert to the upstream mirrors in built Kolla container images.
stackhpc_kolla_clean_up_repo_mirrors: true

Expand All @@ -304,6 +310,13 @@ kolla_build_blocks:
-e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\nbaseurl={{ repo.url }}|' /etc/yum.repos.d/{{ repo.file }}{% if not loop.last %} && \
{% endif %}
{% endfor %}
{% else %}
RUN \
rm /etc/apt/sources.list && \
{% for repo in stackhpc_ubuntu_focal_base_repos %}
echo '{{ repo }}' >> /etc/apt/sources.list {% if not loop.last %} && \
{% endif %}
{% endfor %}
{% endif %}
base_centos_repo_overrides_post_yum: |
{# fixme #}
Expand All @@ -320,9 +333,13 @@ kolla_build_blocks:
-e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\nbaseurl={{ repo.url }}|' /etc/yum.repos.d/{{ repo.file }}{% if not loop.last %} &&{% endif %} \
{% endfor %}
{% endif %}
# With the UCA keyring installed we can now add all repos.
base_ubuntu_package_sources_list: |
{% if stackhpc_kolla_clean_up_repo_mirrors | bool %}
COPY sources.list.ubuntu /etc/apt/sources.list.backup
{% endif %}
RUN \
mv /etc/apt/sources.list /etc/apt/sources.list.backup && \
rm /etc/apt/sources.list && \
{% for repo in stackhpc_ubuntu_focal_repos %}
echo '{{ repo }}' >> /etc/apt/sources.list {% if not loop.last %} && \
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
Fixes an issue with Kolla container image builds for Ubuntu where the
release train package repositories could be behind the container image,
leading to image build failures.

0 comments on commit 910dc74

Please sign in to comment.