Skip to content

Commit 910dc74

Browse files
authored
Merge pull request #733 from stackhpc/yoga-ubuntu-build-deps
Ubuntu: add base repos to Kolla container image earlier
2 parents e7db159 + 604fa6f commit 910dc74

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

etc/kayobe/kolla.yml

+20-3
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,20 @@ base_centos_repo_overrides_post_yum_rocky_list: "{{ stackhpc_rocky_9_repos + sta
277277
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 }}"
278278
stackhpc_yum_repos: "{{ stackhpc_centos_stream_repos if kolla_base_distro == 'centos' else stackhpc_rocky_9_repos }}"
279279

280-
# List of repositories for Ubuntu focal.
281-
stackhpc_ubuntu_focal_repos:
280+
# List of base repositories for Ubuntu Focal.
281+
stackhpc_ubuntu_focal_base_repos:
282282
- "deb {{ stackhpc_repo_ubuntu_focal_url }} focal main universe"
283283
- "deb {{ stackhpc_repo_ubuntu_focal_url }} focal-updates main universe"
284284
- "deb {{ stackhpc_repo_ubuntu_focal_url }} focal-backports main universe"
285285
- "deb {{ stackhpc_repo_ubuntu_focal_security_url }} focal-security main universe"
286+
287+
# List of UCA repositories for Ubuntu Focal.
288+
stackhpc_ubuntu_focal_uca_repos:
286289
- "deb {{ stackhpc_repo_ubuntu_cloud_archive_url }} focal-updates/{{ openstack_release }} main"
287290

291+
# List of repositories for Ubuntu Focal.
292+
stackhpc_ubuntu_focal_repos: "{{ stackhpc_ubuntu_focal_base_repos + stackhpc_ubuntu_focal_uca_repos }}"
293+
288294
# Whether to revert to the upstream mirrors in built Kolla container images.
289295
stackhpc_kolla_clean_up_repo_mirrors: true
290296

@@ -304,6 +310,13 @@ kolla_build_blocks:
304310
-e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\nbaseurl={{ repo.url }}|' /etc/yum.repos.d/{{ repo.file }}{% if not loop.last %} && \
305311
{% endif %}
306312
{% endfor %}
313+
{% else %}
314+
RUN \
315+
rm /etc/apt/sources.list && \
316+
{% for repo in stackhpc_ubuntu_focal_base_repos %}
317+
echo '{{ repo }}' >> /etc/apt/sources.list {% if not loop.last %} && \
318+
{% endif %}
319+
{% endfor %}
307320
{% endif %}
308321
base_centos_repo_overrides_post_yum: |
309322
{# fixme #}
@@ -320,9 +333,13 @@ kolla_build_blocks:
320333
-e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\nbaseurl={{ repo.url }}|' /etc/yum.repos.d/{{ repo.file }}{% if not loop.last %} &&{% endif %} \
321334
{% endfor %}
322335
{% endif %}
336+
# With the UCA keyring installed we can now add all repos.
323337
base_ubuntu_package_sources_list: |
338+
{% if stackhpc_kolla_clean_up_repo_mirrors | bool %}
339+
COPY sources.list.ubuntu /etc/apt/sources.list.backup
340+
{% endif %}
324341
RUN \
325-
mv /etc/apt/sources.list /etc/apt/sources.list.backup && \
342+
rm /etc/apt/sources.list && \
326343
{% for repo in stackhpc_ubuntu_focal_repos %}
327344
echo '{{ repo }}' >> /etc/apt/sources.list {% if not loop.last %} && \
328345
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fixes an issue with Kolla container image builds for Ubuntu where the
5+
release train package repositories could be behind the container image,
6+
leading to image build failures.

0 commit comments

Comments
 (0)