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

Update Docker Image to Ubuntu 24.04 ( Noble ) #2739

Open
wants to merge 39 commits into
base: develop
Choose a base branch
from

Conversation

pentatonicfunk
Copy link
Contributor

Checks

  • I've updated the changelog.
  • I've tested this PR: Partially
  • This PR is for the develop branch not the stable branch.
  • This PR is complete and ready for review.

Note on testing:

  • Currently i only have linux host testing machine. I've tested with Docker provider, and it went okay, logs attached
  • Tried using Virtualbox, but it keeps timing out / error
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
  • If anyone can help testing it, please

Changelogs:

  • Please advise

tomjn and others added 23 commits September 10, 2022 11:55
- Add OVH url in hosts_to_test ( keep the mariadb.gb.ssimn.org )
- Better messages
Copy link

update-docs bot commented Oct 20, 2024

Thanks for opening this pull request! Make sure CHANGELOG.md gets updated with this change, additionally any docs that need updated can be found at https://github.com/Varying-Vagrant-Vagrants/varyingvagrantvagrants.org

GitHub
The VVV docs and website. Contribute to Varying-Vagrant-Vagrants/varyingvagrantvagrants.org development by creating an account on GitHub.

@pentatonicfunk pentatonicfunk requested a review from tomjn October 20, 2024 02:44
@tomjn
Copy link
Member

tomjn commented Oct 20, 2024

@pentatonicfunk how much of this can we split into separate PRs? Upgrading Ubuntu isn't a small task but adding the sources could be done and released pretty quickly to simplfy merging. Likewise some of the other changes are useful and quick to test on their own.

I am mindful that upgrading Ubuntu the last time resulted in some weirdness that needed investigation.

Also, the service changes, I was thinking of changing how services are restarted to use a VVV specific function to insulate against service and systemctl since there's a lot of duplication going on

@pentatonicfunk
Copy link
Contributor Author

i will try to cherry picks into separate branches next week.

This was referenced Oct 20, 2024
config/default-config.yml Outdated Show resolved Hide resolved
@@ -480,7 +480,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Docker use image.
config.vm.provider :docker do |d, override|
d.image = 'pentatonicfunk/vagrant-ubuntu-base-images:20.04'
d.image = 'pentatonicfunk/vagrant-ubuntu-base-images:24.04'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this trigger a VM rebuild for exsting Ubuntu 22 instances that upgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question, i dont know. it would be vagrant territory, no ? the decision whether docker container need rebuild or not would be based on what vagrant flow will be issued. in any case better to test it, i'll try to test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main concerns is if vagrant would kick up a fuss about mismatching images or if it would discard the container ( and the database + data ) to create a new 24 container

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so i tested this, this is how i tested it

use upstream/develop branch

  • Vagrantfile still using 20.04 image
  • do vagrant up --provision
  • verify ubuntu version via vagarant ssh
vagrant@vvv:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal
  • create new post in one.wordpress.test to verify DB okay
image

switch to origin/docker-provider

  • Vagrantfile now 24.4
  • do vagrant halt to stop docker
  • do vagrant reload --provision to trigger reprovision
  • verify ubuntu version via vagarant ssh, expecting the Ubuntu should stay in 20.04
Last login: Fri Nov 15 15:33:51 2024 from 172.17.0.1
vagrant@vvv:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal
  • verify whether DB not discarded ( post still exists )
image

i think this is what we expected, right ?

  • no complains on provisioner
  • container not discarded
  • DB not discarded

i think what we can do is, add somewhere in docs ( if we haven't), if user wants to upgrade their OS is by doing

  • db_backup
  • vagrant destroy
  • vagrant up --provision --> this step will trigger 24.04
  • db_restore

sudo pip3 install wheel
sudo pip3 install shyaml

local OSVERSION_NUMBER=$(lsb_release lsb_release -sr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shellcheck will probably flag this and a few other things, it should be something like this:

Suggested change
local OSVERSION_NUMBER=$(lsb_release lsb_release -sr)
local OSVERSION_NUMBER
OSVERSION_NUMBER=$(lsb_release lsb_release -sr)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjusted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, this adjustments causing error for some reason

lsb_release: error: No arguments are permitted

https://github.com/Varying-Vagrant-Vagrants/VVV/actions/runs/11580749924/job/32239965581?pr=2739

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I think the problem is a mistake on my part, lsb_release vs lsb_release lsb_release

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjusted, and seems to be ran okay: https://github.com/Varying-Vagrant-Vagrants/VVV/actions/runs/11858839047/job/33050382482?pr=2739
let me know if it needs further adjustments

if dpkg --compare-versions "${OSVERSION_NUMBER[@]}" ge "24.04"
then
# to make it available globally this is the last workaround, hopefully it doesn't break the system
# TODO: try to find a better alternative way to install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there somewhere I can read up on why this happens or where the fix came from? Would be good to have it in the comments, I've created a separate PR for shyaml fixes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants