oracle / vagrant-projects

Vagrant projects for Oracle products and other examples
Universal Permissive License v1.0
947 stars 476 forks source link

Wish: Update boxes instead of downloading updates at installation #513

Open ole-tange opened 3 months ago

ole-tange commented 3 months ago

Thanks for making these vagrant images available.

I regularly destroy my vagrant boxes to test on a clean installation.

It therefore slows down my workflow if "vagrant destroy; vagrant up" requires a considerable amount of time and network access.

I have the feeling that the current images have an old base image, and that the first thing it does is to update all packages.

From a security perspective this makes sense. But from a developers perspective it does not: My box will not be accessible to the internet.

It would be really helpful if you were not forced to download updates, but could simply run on the base image.

Alternatively, it would also be useful if the base image was update regularly, so the amount of updates were limited.

Again I want to thank you for making the images available, and I hope you will consider either not forcing update or updating the base image regularly.

AmedeeBulle commented 3 months ago

There is nothing in the box itself which triggers an update when it is instantiated. However quite some of the projects from this repository are doing a dnf update in their provisioning scripts; you might want to comment that out in the scripts is security is not your concern.

I do agree with you that the current boxes are due for a refresh, publication is a bit delayed, apologies for that.

PaulNeumann commented 3 months ago

One way to maintain a clean installation without having to constantly destroy and re-provision the VM is to use Vagrant's snapshot functionality.

After the initial provisioning is complete, shut the VM down (vagrant halt), then save a snapshot of the clean installation (vagrant snapshot save CLEAN). You can use any snapshot name you like; CLEAN is just the name I usually use. Then you can restart the VM with vagrant up, and install/change/test whatever you need to. When you're ready to restore the clean installation, just shut down the VM again and restore the snapshot with vagrant snapshot restore CLEAN --nostart.

You can repeat this cycle as often as needed without having to re-provision the VM.

ole-tange commented 3 months ago

There is nothing in the box itself which triggers an update when it is instantiated.

I have re-run vagrant destroy; vagrant up. It seems it is these steps in scripts/install.sh that trigger the downloads:

dnf upgrade -y                                                                                                                                     
dnf reinstall -y glibc-common
dnf install -y oracle-database-preinstall-21c openssl
  curl -Ls -o /vagrant/"${db_installer}" \
       https://download.oracle.com/otn-pub/otn_software/db-free/"${db_installer}"
dnf -y localinstall /vagrant/"${db_installer}"

From:

==> oracle21c-xe-vagrant: Importing base box 'oraclelinux/8'...

I get the feeling it is currently using oraclelinux/8 as its base box.

So I am thinking that it would make sense to make a base box that is based on the state after “echo 'INSTALLER: Oracle software installed'” – after all the download has happened.

I would prefer this to be an official box from Oracle, but would it be legal for me to distribute a box that is just the “half-completed” installation as described above? It is especially the dnf -y localinstall /vagrant/"${db_installer}" I am concerned with the legality of, as I would then be distributing software under a license that is unclear to me.

It seems such a box will be around 3 GB.

ole-tange commented 3 months ago

Oracle DB 23.4.0-Free seems to be under this license: https://www.oracle.com/downloads/licenses/oracle-free-license.html

The relevant paragraph (my emphasis):

Oracle grants to You, as a recipient of this Program, a nonexclusive, nontransferable, limited license to, subject to the conditions stated herein, (a) internally use the unmodified Programs for the purposes of developing, testing, prototyping and demonstrating your applications, and running the Programs for your own internal business operations; and (b) redistribute unmodified Programs and Programs Documentation, under the terms of this License, provided that You do not charge Your end users any additional fees for the use of the Programs.

It is unclear to me if a half-installed version (i.e. software installed, but not configured) would be regarded as "unmodified".

AmedeeBulle commented 3 months ago

There is nothing in the box itself which triggers an update when it is instantiated.

I have re-run vagrant destroy; vagrant up. It seems it is these steps in scripts/install.sh that trigger the downloads:

Yes, that's what I meant -- the OL8 base box doesn't upgrade itself, it is the Vagrant project which does is.

So I am thinking that it would make sense to make a base box that is based on the state after “echo 'INSTALLER: Oracle software installed'” – after all the download has happened.

With all the moving parts (range of products, versions, ...) this would represent a lot of boxes to maintain... Oracle provides the base Linux boxes, with Vagrant projects to extend these. We are doing the same for with containers in the oracle/docker-images project.

It is unclear to me if a half-installed version would be regarded as "unmodified".

This is definitely something you can do for your own usage, but afaik you are not allowed to redistribute -- @totalamateurhour can you confirm this?

totalamateurhour commented 2 months ago

I'm deferring to @gvenzl on this.

It is unclear to me if a half-installed version (i.e. software installed, but not configured) would be regarded as "unmodified".