MyETM is the central hub of the Energy Transition Model (ETM), allowing users to view saved scenarios and collections across different versions. To run MyETM locally, you will need to set up the entire ETM ecosystem, which consists of: MyETM: The central hub for scenario management. ETEngine: The main calculation system and API. ETModel: The front-end for creating scenarios with a user interface. ETSource: The repository containing source data required by ETEngine.
MyETM is released under the MIT License.
MyETM, ETEngine, and ETModel are configured to run with Docker (via Docker Compose), simplifying dependency management. This guide assumes that Docker is already installed and configured on your machine.
Ensure all ETM components reside in the same parent directory by cloning the repositories:
git clone https://github.com/quintel/etengine.git
git clone https://github.com/quintel/etmodel.git
git clone https://github.com/quintel/etsource.git
git clone https://github.com/quintel/myetm.git
This will create a directory with the following structure:
├─ parent_dir
│ ├─ etmodel
│ ├─ myetm
│ ├─ etsource
│ └─ etengine
ETSource requires a password to decrypt certain datasets. To set this up: 1. Create a .password file in the ETSource directory. 2. Obtain the password from the "Quintel → Shared" 1Password vault. 3. Save the password inside .password.
├─ etsource
│ ├─ .password # <- Place password here
│ ├─ carriers
│ ├─ config
│ ├─ datasets
Public users will not have access to encrypted datasets and should use alternative datasets as indicated in the documentation.
cd myetm
docker-compose build
docker-compose run --rm web bash -c 'chmod +x bin/setup && bin/rails db:drop && bin/setup'
For updates, install new dependencies using:
docker-compose run --rm web bin/setup
This command is idempotent and can be run anytime as needed.
docker-compose up
Once running, MyETM will be available at http://localhost:3002.
Installing MyETM on a local machine can be a bit involved, owing to the number of dependencies. Assuming you can run a 'normal' rails application on your local machine, you have to follow these steps to run MyETM.
-
Install the "Graphviz" library
- Mac users with [Homebrew][homebrew]:
brew install graphviz
- Ubuntu:
sudo apt-get install graphviz libgraphviz-dev
- Mac users with [Homebrew][homebrew]:
-
Install "MySQL" server
- Mac: Install latest version using the [Native Package][mysql] (choose the 64-bit DMG version), or install via brew:
brew install mysql
- Ubuntu:
sudo apt-get install mysql-server-5.5 libmysqlclient-dev
- Mac: Install latest version using the [Native Package][mysql] (choose the 64-bit DMG version), or install via brew:
-
Clone this repository with
git clone [email protected]:quintel/myetm.git
-
Run
bundle install
to install the dependencies required by MyETM. -
Clone a copy of [ETSource][etsource] –– which contains the data for each region:
cd ..; git clone [email protected]:quintel/etsource.git
cd etsource; bundle install
-
Create the database you specified in your "database.yml" file, and
- run
bundle exec rake db:setup
to create the tables and add an administrator account –– whose name and password will be output at the end –– OR - run
bundle exec rake db:create
to create your database and contact the private Quintel slack channel to fill your database with records from staging server
- run
-
You're now ready-to-go! Fire up the Rails process with
rails s
or betterbin/dev
. -
If you run into an dataset error, check out this explanation on CSV files
After setting up MyETM, configure it to communicate with ETEngine and ETModel:
- Log in to MyETM as an administrator.
- Navigate to Your Applications in the admin panel.
- Create new applications for ETEngine (Local), ETModel (Local) and Collections (Local).
- Copy the generated configuration into
config/settings.local.yml
for both ETEngine and ETModel. Copy it into.env.local
for Collections.