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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5b3aa20
Merge branch 'develop' into stable
tomjn Sep 10, 2022
dd9691e
Attempt to fix git safe dir issue
pentatonicfunk Sep 30, 2022
312aed8
Fix git safe.directory script
pentatonicfunk Sep 30, 2022
d28080c
Merge pull request #2652 from Varying-Vagrant-Vagrants/develop
tomjn Mar 14, 2023
3b367ce
Merge pull request #2669 from Varying-Vagrant-Vagrants/develop
tomjn May 9, 2023
aee9a69
Merge pull request #2684 from Varying-Vagrant-Vagrants/develop
tomjn Aug 3, 2023
f3ef893
Merge branch 'develop' into stable
tomjn Jun 16, 2024
e0dad5d
Merge pull request #2720 from Varying-Vagrant-Vagrants/develop
tomjn Jul 19, 2024
12be863
Merge remote-tracking branch 'upstream/stable' into docker-provider-beta
pentatonicfunk Oct 19, 2024
cfd11ad
Merge remote-tracking branch 'upstream/develop' into docker-provider-…
pentatonicfunk Oct 19, 2024
3a9de05
Update mariadb repo to OVH for ubuntu focal
pentatonicfunk Oct 19, 2024
4c38733
Use `mysql` as service name in docker
pentatonicfunk Oct 19, 2024
bbcf60d
Use `mysql` as service name in docker -- vagrant_up
pentatonicfunk Oct 19, 2024
30b8230
Attempt to dynamically get mysql service name
pentatonicfunk Oct 19, 2024
c798cef
Fix inverted `vvv_get_mysql_service_name`
pentatonicfunk Oct 19, 2024
87ba465
Fix syntax issue
pentatonicfunk Oct 19, 2024
fb41956
More messages fix
pentatonicfunk Oct 19, 2024
80275ed
Attempt to add more Ubuntu noble repo list
pentatonicfunk Oct 19, 2024
8d9dd89
Dummy vvv sources list for noble
pentatonicfunk Oct 19, 2024
237b447
Attempt to solve shyaml pip install
pentatonicfunk Oct 19, 2024
3dc8769
Fix dpkg version compare relation arg
pentatonicfunk Oct 19, 2024
c705505
Allow custom PHP CLI version
pentatonicfunk Oct 20, 2024
e85f98a
Use ubuntu 24.04 as default image for docker provider
pentatonicfunk Oct 20, 2024
c72778f
Revert git safe dir setup
pentatonicfunk Oct 20, 2024
33db168
Fix comments copy in provision/core/mariadb/provision.sh
pentatonicfunk Oct 21, 2024
227a983
Update Changelog
pentatonicfunk Oct 29, 2024
2367444
Revert "Allow custom PHP CLI version"
pentatonicfunk Oct 29, 2024
6809d61
Revert "Fix syntax issue"
pentatonicfunk Oct 29, 2024
2d42d49
Revert "Fix inverted `vvv_get_mysql_service_name`"
pentatonicfunk Oct 29, 2024
754ac15
Revert "Attempt to dynamically get mysql service name"
pentatonicfunk Oct 29, 2024
c544d5a
Revert "Use `mysql` as service name in docker -- vagrant_up"
pentatonicfunk Oct 29, 2024
196887e
Revert "Use `mysql` as service name in docker"
pentatonicfunk Oct 29, 2024
d224835
Merge remote-tracking branch 'upstream/develop' into docker-provider-…
pentatonicfunk Oct 29, 2024
060f8a0
Merge remote-tracking branch 'origin/docker-provider-beta' into docke…
pentatonicfunk Oct 29, 2024
3e6aec5
Minor script adjustment https://github.com/Varying-Vagrant-Vagrants/V…
pentatonicfunk Oct 29, 2024
ebf8675
Merge remote-tracking branch 'origin/docker-provider-beta' into docke…
pentatonicfunk Oct 29, 2024
a6b4f7f
Revert "Minor script adjustment https://github.com/Varying-Vagrant-Va…
pentatonicfunk Oct 29, 2024
0094cb0
Merge remote-tracking branch 'origin/docker-provider-beta' into docke…
pentatonicfunk Oct 29, 2024
88418dd
Improve OS version number check on `shyaml_setup`
pentatonicfunk Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ permalink: /docs/en-US/changelog/
* Provisioner/Hook timings now show milliseconds ( #2735 )
* Added a `skip_site_provisioner_update` option to prevent site provisioners being overwritten by updates ( #2733 )
* Only start services that aren't running in post-up scripts ( #2732 )
* Upgraded Ubuntu from 20.04 to 24.04 for docker provider ( #2739 )

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

d.has_ssh = true
d.ports = [ "80:80" ] # HTTP
d.ports += [ "443:443" ] # HTTPS
Expand Down
2 changes: 1 addition & 1 deletion config/homebin/vagrant_up
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [[ -f /srv/config/homebin/vagrant_up_custom ]]; then
fi

# /etc/host doesn't survive restart on docker
vvv_info " * Updatin Guest VM /etc/hosts"
vvv_info " * Updating Guest VM /etc/hosts"
vvv_update_guest_hosts

if ! sudo service nginx status > /dev/null; then
Expand Down
18 changes: 16 additions & 2 deletions provision/core/vvv/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,22 @@ function shyaml_setup() {
# Used for passing custom parameters to the bash provisioning scripts
if [ ! -f /usr/local/bin/shyaml ]; then
vvv_info " * Installing Shyaml for bash provisioning.."
sudo pip3 install wheel
sudo pip3 install shyaml

local OSVERSION_NUMBER
OSVERSION_NUMBER=$(lsb_release -sr)

# Ubuntu 24 making it hard to install pip packages, throwing externally-managed-environment error
# https://stackoverflow.com/a/75722775
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.

sudo pip3 install wheel --break-system-packages
sudo pip3 install shyaml --break-system-packages
else
sudo pip3 install wheel
sudo pip3 install shyaml
fi
fi
}
export -f shyaml_setup
Expand Down