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

updated initialization script for amd64 and arm64. #546

Merged
merged 8 commits into from
Jul 5, 2023

Conversation

gainesaw
Copy link
Collaborator

@gainesaw gainesaw commented Jun 30, 2023

PR Details

Description

script now installs necessary dependencies, creates secret files, prompts user to input mysql passwords, and create v2xhub user

Related Issue

VH-1227

#592

Motivation and Context

requested by project leads, automates v2xhub setup/initialization

How Has This Been Tested?

code has been used to setup v2xhub from scratch

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • [ x] New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • [x ] My change requires a change to the documentation.
  • ###potential change to documentation as running this script automates setup. user only needs to clone the repo, run the script, and input passwords when prompted, then navigate to https://127.0.0.1:19760 to accept security certs then v2xhub is ready to use.
  • I have updated the documentation accordingly.
  • [x ] I have read the CONTRIBUTING document.
    V2XHUB Contributing Guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

script now installs necessary dependencies, creates secret files, prompts user to input mysql passwords, and create v2xhub user

sudo apt-get update -y && sudo apt update -y

echo -e "\n open chromium-browser, go to https://127.0.0.1:19760, accept certs, and go to https://127.0.0.1 to login to V2x hub."
Copy link
Contributor

Choose a reason for hiding this comment

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

You know what would potentially be a nice to have. Can we launch chromium or the default browser from this script to automatically route to both the certificate page and the login page?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this works chromium-browser https://www.google.com for one tab still looking if we can do something for 2 tabs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if we run
chromium-browser "https://127.0.0.1" > /dev/null 2>&1 &
chromium-browser "https://127.0.0.1:19760" > /dev/null 2>&1 &
it opens both tabs, I will update file to have that

tr -d '\n' <sql_root_pass.txt> mysql_root_password.txt && tr -d '\n' <sql_pass.txt> mysql_password.txt
rm sql_root_pass.txt && rm sql_pass.txt

#ARM initialization
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get update
Copy link
Contributor

Choose a reason for hiding this comment

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

We can probably remove all redundant update calls unless we are adding a apt repository somewhere. We only really new one.

updated script using comments from Paul
updated arm initialization script based on comments from reviewer on amd64 initialization script
updated line 29 to move back 1 directory so that it can get into mysql to run the v2xhub user creation script. line to go back directory was mistakenly removed during edits
updated to include cd .. (line 28) as it was mistakenly remove. before this update script wouldn't be able to run script to add v2xhub user
rm sql_root_pass.txt && rm sql_pass.txt

#AMD64 initialzation
cd ..
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get update
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks great. The last change I would suggest is making a single call for
apt-get update
Unless we are adding repositories somewhere in this script, multiple calls should not be necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed the duplicate apt-get updates in the lines, I left one update/upgrade line in the beginning and one at the end because I've ran into issues with the OS not being updated in the beginning, it being unable to install everything, and not running it before docker-compose up -d had the php and mysql fail to launch

removed duplicated apt-get update lines leaving one at beginning and one at end
same changes as amd64, removed duplicate apt-get update lines
@paulbourelly999 paulbourelly999 merged commit b708d32 into develop Jul 5, 2023
8 checks passed
@paulbourelly999 paulbourelly999 deleted the update_initialization_script branch July 5, 2023 19:14
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