Skip to content

Commit

Permalink
feat: Improve manual installation
Browse files Browse the repository at this point in the history
  • Loading branch information
drorganvidez committed Sep 8, 2024
1 parent fcd0553 commit 3b7b80e
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 10 deletions.
10 changes: 5 additions & 5 deletions _site/assets/js/search-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@
},"97": {
"doc": "Manual installation",
"title": "Table of contents",
"content": ". | Update the system | Clone the repo | Install MariaDB . | Install official package | Start the MariaDB service | Configure MariaDB | Configure databases and users | . | Configure app environment . | Creates and activate a virtual environment | Install Python dependencies | Install Python dependencies in editable mode | . | Run app . | Environment variables | Apply migrations | Popular database | Boot development Flask server | . | . Python version . Python version 3.12 or higher is recommended. Ubuntu-only support . This tutorial is intended for use on Ubuntu 22.04 LTS or higher. ",
"content": ". | Update the system | Clone the repo | Install MariaDB . | Install official package | Start the MariaDB service | Configure MariaDB | Configure databases and users | . | Configure app environment . | Creates and activate a virtual environment | Install Python dependencies | Install Python dependencies in editable mode | Ignore webhook module | . | Run app . | Environment variables | Apply migrations | Popular database | Boot development Flask server | . | . Python version . Python version 3.12 or higher is recommended. Ubuntu-only support . This tutorial is intended for use on Ubuntu 22.04 LTS or higher. ",
"url": "/installation/manual_installation#table-of-contents",

"relUrl": "/installation/manual_installation#table-of-contents"
Expand All @@ -694,28 +694,28 @@
},"99": {
"doc": "Manual installation",
"title": "Clone the repo",
"content": "git clone https://github.com/diverso-lab/uvlhub.git cd uvlhub . ",
"content": "Are you a student of Configuration Evolution and Management (EGC)? . Remember that you have to clone from the subject fork instead of the official one. git clone https://github.com/EGCETSII/uvlhub.git cd uvlhub . You can clone the original repo with the HTTPS method: . git clone https://github.com/diverso-lab/uvlhub.git cd uvlhub . ",
"url": "/installation/manual_installation#clone-the-repo",

"relUrl": "/installation/manual_installation#clone-the-repo"
},"100": {
"doc": "Manual installation",
"title": "Install MariaDB",
"content": "Install official package . MariaDB is available in the official Ubuntu repositories, so you can easily install it with apt: . sudo apt install mariadb-server -y . Start the MariaDB service . sudo systemctl start mariadb . Configure MariaDB . After installing MariaDB, it is recommended to run the security script to perform some initial configurations: . sudo mysql_secure_installation . - Enter current password for root (enter for none): (enter) - Switch to unix_socket authentication [Y/n]: `y` - Change the root password? [Y/n]: `y` - New password: `uvlhubdb_root_password` - Re-enter new password: `uvlhubdb_root_password` - Remove anonymous users? [Y/n]: `y` - Disallow root login remotely? [Y/n]: `y` - Remove test database and access to it? [Y/n]: `y` - Reload privilege tables now? [Y/n] : `y` . Configure databases and users . Using uvlhubdb_root_password as root password: . sudo mysql -u root -p . CREATE DATABASE uvlhubdb; CREATE DATABASE uvlhubdb_test; CREATE USER 'uvlhubdb_user'@'localhost' IDENTIFIED BY 'uvlhubdb_password'; GRANT ALL PRIVILEGES ON uvlhubdb.* TO 'uvlhubdb_user'@'localhost'; GRANT ALL PRIVILEGES ON uvlhubdb_test.* TO 'uvlhubdb_user'@'localhost'; FLUSH PRIVILEGES; EXIT; . ",
"content": "Install official package . MariaDB is available in the official Ubuntu repositories, so you can easily install it with apt: . sudo apt install mariadb-server -y . Start the MariaDB service . sudo systemctl start mariadb . Configure MariaDB . After installing MariaDB, it is recommended to run the security script to perform some initial configurations: . sudo mysql_secure_installation . - Enter current password for root (enter for none): (enter) - Switch to unix_socket authentication [Y/n]: `y` - Change the root password? [Y/n]: `y` - New password: `uvlhubdb_root_password` - Re-enter new password: `uvlhubdb_root_password` - Remove anonymous users? [Y/n]: `y` - Disallow root login remotely? [Y/n]: `y` - Remove test database and access to it? [Y/n]: `y` - Reload privilege tables now? [Y/n] : `y` . Configure databases and users . To configure the database, we are going to use the MariaDB command console: . sudo mysql -u root -p . Use uvlhubdb_root_password as root password. CREATE DATABASE uvlhubdb; CREATE DATABASE uvlhubdb_test; CREATE USER 'uvlhubdb_user'@'localhost' IDENTIFIED BY 'uvlhubdb_password'; GRANT ALL PRIVILEGES ON uvlhubdb.* TO 'uvlhubdb_user'@'localhost'; GRANT ALL PRIVILEGES ON uvlhubdb_test.* TO 'uvlhubdb_user'@'localhost'; FLUSH PRIVILEGES; EXIT; . ",
"url": "/installation/manual_installation#install-mariadb",

"relUrl": "/installation/manual_installation#install-mariadb"
},"101": {
"doc": "Manual installation",
"title": "Configure app environment",
"content": "Creates and activate a virtual environment . python3 -m venv venv source venv/bin/activate . Install Python dependencies . pip install --upgrade pip pip install -r requirements.txt . Install Python dependencies in editable mode . pip install -e ./ . ",
"content": "Creates and activate a virtual environment . sudo apt install python3.12-venv python3 -m venv venv source venv/bin/activate . Install Python dependencies . pip install --upgrade pip pip install -r requirements.txt . Install Python dependencies in editable mode . pip install -e ./ . Ignore webhook module . The webhook module only makes sense in a deployment using Docker and in a pre-production environment. To avoid problems, we indicate that this module should be ignored in the initial loading of modules by appending the name to the .moduleignore file: . echo \"webhook\" > .moduleignore . ",
"url": "/installation/manual_installation#configure-app-environment",

"relUrl": "/installation/manual_installation#configure-app-environment"
},"102": {
"doc": "Manual installation",
"title": "Run app",
"content": "Environment variables . cp .env.local.example .env . Apply migrations . rosemary db:migrate . Popular database . rosemary db:seed . Boot development Flask server . flask run --host=0.0.0.0 --reload --debug . If everything worked correctly, you should see the deployed version of uvlhub in development at http://localhost:5000 . ",
"content": "Environment variables . cp .env.local.example .env . Apply migrations . flask db upgrade . Popular database . rosemary db:seed . Boot development Flask server . flask run --host=0.0.0.0 --reload --debug . If everything worked correctly, you should see the deployed version of uvlhub in development at http://localhost:5000 . ",
"url": "/installation/manual_installation#run-app",

"relUrl": "/installation/manual_installation#run-app"
Expand Down
35 changes: 32 additions & 3 deletions _site/installation/manual_installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ <h2 class="no_toc text-delta" id="table-of-contents">
<li><a href="#creates-and-activate-a-virtual-environment" id="markdown-toc-creates-and-activate-a-virtual-environment">Creates and activate a virtual environment</a></li>
<li><a href="#install-python-dependencies" id="markdown-toc-install-python-dependencies">Install Python dependencies</a></li>
<li><a href="#install-python-dependencies-in-editable-mode" id="markdown-toc-install-python-dependencies-in-editable-mode">Install Python dependencies in editable mode</a></li>
<li><a href="#ignore-webhook-module" id="markdown-toc-ignore-webhook-module">Ignore <code class="language-plaintext highlighter-rouge">webhook</code> module</a></li>
</ol>
</li>
<li><a href="#run-app" id="markdown-toc-run-app">Run app</a> <ol>
Expand Down Expand Up @@ -357,6 +358,17 @@ <h2 id="clone-the-repo">
</h2>


<blockquote class="important-title">
<p><i class="fa-solid fa-graduation-cap"></i> Are you a student of Configuration Evolution and Management (EGC)?</p>

<p>Remember that you have to clone from the subject fork instead of the official one.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/EGCETSII/uvlhub.git
cd uvlhub
</code></pre></div> </div>
</blockquote>

<p>You can clone the original repo with the HTTPS method:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/diverso-lab/uvlhub.git
cd uvlhub
</code></pre></div></div>
Expand Down Expand Up @@ -425,11 +437,13 @@ <h3 id="configure-databases-and-users">
</h3>


<p>Using <code class="language-plaintext highlighter-rouge">uvlhubdb_root_password</code> as root password:</p>
<p>To configure the database, we are going to use the MariaDB command console:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mysql -u root -p
</code></pre></div></div>

<p>Use <code class="language-plaintext highlighter-rouge">uvlhubdb_root_password</code> as root password.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>CREATE DATABASE uvlhubdb;
CREATE DATABASE uvlhubdb_test;
CREATE USER 'uvlhubdb_user'@'localhost' IDENTIFIED BY 'uvlhubdb_password';
Expand All @@ -455,7 +469,8 @@ <h3 id="creates-and-activate-a-virtual-environment">
</h3>


<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>python3 -m venv venv
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo apt install python3.12-venv
python3 -m venv venv
source venv/bin/activate
</code></pre></div></div>
<h3 id="install-python-dependencies">
Expand All @@ -481,6 +496,20 @@ <h3 id="install-python-dependencies-in-editable-mode">

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pip install -e ./
</code></pre></div></div>
<h3 id="ignore-webhook-module">


<a href="#ignore-webhook-module" class="anchor-heading" aria-labelledby="ignore-webhook-module"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Ignore <code class="language-plaintext highlighter-rouge">webhook</code> module


</h3>


<p>The <code class="language-plaintext highlighter-rouge">webhook</code> module only makes sense in a deployment using Docker and in a pre-production environment. To avoid problems, we indicate that this module should be
ignored in the initial loading of modules by appending the name to the <code class="language-plaintext highlighter-rouge">.moduleignore</code> file:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo "webhook" &gt; .moduleignore
</code></pre></div></div>
<h2 id="run-app">


Expand Down Expand Up @@ -509,7 +538,7 @@ <h3 id="apply-migrations">
</h3>


<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rosemary db:migrate
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>flask db upgrade
</code></pre></div></div>
<h3 id="popular-database">

Expand Down
27 changes: 25 additions & 2 deletions installation/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ sudo apt upgrade -y

## Clone the repo

{: .important-title }
> <i class="fa-solid fa-graduation-cap"></i> Are you a student of Configuration Evolution and Management (EGC)?
>
> Remember that you have to clone from the subject fork instead of the official one.
> ```
> git clone https://github.com/EGCETSII/uvlhub.git
> cd uvlhub
> ```
You can clone the original repo with the HTTPS method:
```
git clone https://github.com/diverso-lab/uvlhub.git
cd uvlhub
Expand Down Expand Up @@ -79,12 +90,14 @@ sudo mysql_secure_installation
### Configure databases and users
Using `uvlhubdb_root_password` as root password:
To configure the database, we are going to use the MariaDB command console:
```
sudo mysql -u root -p
```
Use `uvlhubdb_root_password` as root password.
```
CREATE DATABASE uvlhubdb;
CREATE DATABASE uvlhubdb_test;
Expand All @@ -100,6 +113,7 @@ EXIT;
### Creates and activate a virtual environment
```
sudo apt install python3.12-venv
python3 -m venv venv
source venv/bin/activate
```
Expand All @@ -118,6 +132,15 @@ pip install -r requirements.txt
pip install -e ./
```
### Ignore `webhook` module
The `webhook` module only makes sense in a deployment using Docker and in a pre-production environment. To avoid problems, we indicate that this module should be
ignored in the initial loading of modules by appending the name to the `.moduleignore` file:
```
echo "webhook" > .moduleignore
```
## Run app
### Environment variables
Expand All @@ -129,7 +152,7 @@ cp .env.local.example .env
### Apply migrations
```
rosemary db:migrate
flask db upgrade
```
### Popular database
Expand Down

0 comments on commit 3b7b80e

Please sign in to comment.