dev4vater / vater

11 stars 4 forks source link

Create `control.py` that will setup the `control` VM #144

Closed uwardlaw closed 2 years ago

uwardlaw commented 2 years ago

Reference:

control.py

uwardlaw commented 2 years ago

The best way to ensure software versions between control instances is probably some level of command line manipulation involving dpkg, tr, and cut. We can save a heavily manipulated file in vater/control-services and then use the python3 apt module to install the packages during install.

Here's an example just in the shell:

control@control:~/vater$ dpkg -l | tr -s ' ' | cut -d ' ' -f 2,3 | tr ' ' '=' | grep zerofree
zerofree=1.1.1-1
control@control:~/vater$ sudo apt install $(dpkg -l | tr -s ' ' | cut -d ' ' -f 2,3 | tr ' ' '=' | grep zerofree)
Reading package lists... Done
Building dependency tree
Reading state information... Done
zerofree is already the newest version (1.1.1-1).
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
control@control:~/vater$ dpkg -l | tr -s ' ' | cut -d ' ' -f 2,3 | tr ' ' '=' | grep zerofree > packages
control@control:~/vater$ cat packages
zerofree=1.1.1-1
control@control:~/vater$ sudo apt remove zerofree
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  zerofree
0 upgraded, 0 newly installed, 1 to remove and 15 not upgraded.
After this operation, 25.6 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 108176 files and directories currently installed.)
Removing zerofree (1.1.1-1) ...
Processing triggers for man-db (2.9.1-1) ...
control@control:~/vater$ sudo apt install $(cat packages)
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  zerofree
0 upgraded, 1 newly installed, 0 to remove and 15 not upgraded.
Need to get 8,520 B of archives.
After this operation, 25.6 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 zerofree amd64 1.1.1-1 [8,520 B]
Fetched 8,520 B in 0s (49.0 kB/s)
Selecting previously unselected package zerofree.
(Reading database ... 108171 files and directories currently installed.)
Preparing to unpack .../zerofree_1.1.1-1_amd64.deb ...
Unpacking zerofree (1.1.1-1) ...
Setting up zerofree (1.1.1-1) ...
Processing triggers for man-db (2.9.1-1) ...
Programmerguy101 commented 2 years ago

Should we look at all the package versions including the auto installed packages or keep the research to manually installed packages only. Also these are the manually installed packages and their versions:

manualPackages
uwardlaw commented 2 years ago

All of the packages installed on the system. We need to be able to test Control today and be able to build the exact same Control four months later. This will include the manual packages.

Programmerguy101 commented 2 years ago

How is dev being enabled? Would passing in an argument such as 'dev' with the control.py be good enough? Also, for checking if the computer is connected to the internet would something like doing a simple get request to a website be good enough?

uwardlaw commented 2 years ago

Dev mode is likely to be enabled in the launch.ps1 and set in the config,json. There's a dev key that can be checked.

Why would you need to check if the computer is connected to the Internet?

Programmerguy101 commented 2 years ago

Issue 103 mentions that we need to check if the environment is connected to the internet or not. Sounds good on the dev situation.

uwardlaw commented 2 years ago

I don't think that issue says anything about needing to check for internet connection. I was enumerating the different release situations and their environments.

Most services that require internet access will fail in a good state if they don't make a connection (apt), so I don't see a need to test for it directly. Do you have something in mind that makes you feel differently?

Programmerguy101 commented 2 years ago

Nope, I agree. Just wanted to cover the bases and not make assumptions.

marissaeinhorn commented 2 years ago

Setup for post foundry integration will be minimal. Not required for RANS implementation or intermediate solution