Skip to content
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

Don't leave the default set of archive servers #33

Merged
merged 1 commit into from
Mar 19, 2023

Conversation

nobuto-m
Copy link
Contributor

@nobuto-m nobuto-m commented Mar 14, 2023

Follow-up of c39bef1.

If we don't disable it, the system uses both the default set of servers
and the mirror specified. It's not so harmful in fully online scenarios,
but it causes issues in air-gapped or restricted environments. By
leaving the default servers, the retrofitting process has to wait for
timeout for each component like DNS timeout for archive.ubuntu.com and
it makes the process longer than usual like from a few minutes to hours
unnecessarily.

Also, the step to disable those servers must be 02- or earlier since
03-baseline-tools already uses APT so the original 42- position was too
late. Furthermore, putting multi-line content into DIB_UBUNTU_MIRROR is
not ideal but it's necessary to keep the backward compatibility. It was
nicer if we leveraged DIB_DISTRIBUTION_MIRROR in
diskimage_builder/elements/ubuntu/pre-install.d/01-set-ubuntu-mirror and
DIB_DEBIAN_COMPONENTS in the first place.

Closes-Bug: https://launchpad.net/bugs/2011527

@nobuto-m nobuto-m marked this pull request as draft March 15, 2023 08:06
@nobuto-m
Copy link
Contributor Author

03-baseline-tools also uses apt-get update basically so we need to set the mirror earlier than the current phase.

@nobuto-m nobuto-m force-pushed the disable-default-archive branch 3 times, most recently from 75fa919 to f2c9ea2 Compare March 17, 2023 00:46
Follow-up of c39bef1.

If we don't disable it, the system uses both the default set of servers
and the mirror specified. It's not so harmful in fully online scenarios,
but it causes issues in air-gapped or restricted environments. By
leaving the default servers, the retrofitting process has to wait for
timeout for each component like DNS timeout for archive.ubuntu.com and
it makes the process longer than usual like from a few minutes to hours
unnecessarily.

Also, the step to disable those servers must be 02- or earlier since
03-baseline-tools already uses APT so the original 42- position was too
late. Furthermore, putting multi-line content into DIB_UBUNTU_MIRROR is
not ideal but it's necessary to keep the backward compatibility. It was
nicer if we leveraged DIB_DISTRIBUTION_MIRROR in
diskimage_builder/elements/ubuntu/pre-install.d/01-set-ubuntu-mirror and
DIB_DEBIAN_COMPONENTS in the first place.

Closes-Bug: https://launchpad.net/bugs/2011527
@nobuto-m nobuto-m marked this pull request as ready for review March 17, 2023 11:53
@wolsen
Copy link
Contributor

wolsen commented Mar 18, 2023

Hmm, it would be ideal to use the DIB_DISTRIBUTION_MIRROR and DIB_DEBIAN_COMPONENTS original (as requested in the review for pull request #20). However, it has its own limitations as the ubuntu elements don't support the DIB_DEBIAN_COMPONENTS option.

I think the right design would probably be to get away from the oneline apt sources format and move to the DEB 822 format (introduced in apt 1.1 so any modern Ubuntu has it). This would allow us to add a .sources file instead of a .list file and specify the Types, URIs, Suites (aka pockets), Components and Options separately which I think is easier to configure from a snap and/or charm perspective.

That seems like a lot of refactoring, and this solution may be okay for the short term while switching to deb822 format should allow a migration path that allows for the multiline solution (which really a multi-suites and components option).

@wolsen wolsen merged commit f0dac14 into openstack-charmers:master Mar 19, 2023
openstack-mirroring pushed a commit to openstack/charm-octavia-diskimage-retrofit that referenced this pull request May 26, 2023
To reflect changes made in the equivalent snap.
openstack-charmers/octavia-diskimage-retrofit#33

Closes-Bug: #2011527
Change-Id: I5d5b1110e1efb3b92b4443b1a8b786cf58102910
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request May 26, 2023
* Update charm-octavia-diskimage-retrofit from branch 'master'
  to 939a008141bb9e5d5390b491cb1713fd7e1c524c
  - Merge "Update example for "ubuntu-mirror""
  - Update example for "ubuntu-mirror"
    
    To reflect changes made in the equivalent snap.
    openstack-charmers/octavia-diskimage-retrofit#33
    
    Closes-Bug: #2011527
    Change-Id: I5d5b1110e1efb3b92b4443b1a8b786cf58102910
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants