Development and production environments¶
Note
as a soweego user or contributor, you will typically use the Development environment. The Production environment is tailored for Cloud VPS project members.
First of all¶
Install Docker, then clone soweego:
$ git clone https://github.com/Wikidata/soweego.git
$ cd soweego
Development environment¶
Use it to run or play around soweego on your local machine. And to contribute new features, of course!
This environment ships with a MariaDB database instance and a BASH shell. It is ready to run The command line. Feel free to hack soweego while the environment is running: your code is synced.
Get set¶
Just install Docker Compose.
Go¶
$ ./docker/run.sh
Building soweego
...
root@70c9b4894a30:/app/soweego#
You are now in a BASH shell with a fully working soweego instance. Check if everything went fine with a shot of
python -m soweego
run.sh
options¶
Option |
Expected value |
Default value |
Description |
---|---|---|---|
|
a directory path |
|
Directory shared between the soweego Docker container and your local filesystem |
Access the local database instance¶
As easy as:
$ docker exec -it soweego_db_1 /bin/bash
root@0f51e7c512df:/# mysql -uroot -hlocalhost -pdba soweego
MariaDB [soweego]>
Production environment¶
soweego lives in a Wikimedia Cloud VPS project, and this is the environment deployed there. Please contact the project administrators if you want to help with the VPS machine.
You can also use it to run soweego on a machine that already has a working database (typically a server).
This environment ships with a BASH shell ready to run The command line. Feel free to hack soweego while the environment is running: your code is synced.
Get set¶
Just create a credentials JSON file like this:
{
"DB_ENGINE": "mysql+pymysql",
"HOST": "${DB_IP_ADDRESS}",
"USER": "${DB_USER}",
"PASSWORD": "${DB_PASSWORD}",
"TEST_DB": "soweego",
"PROD_DB": "${DB_NAME}"
}
Don’t forget to set the ${...}
variables!
Go¶
$ ./docker/prod.sh -c ${YOUR_CREDENTIALS_FILE}
Sending build context to Docker daemon
...
root@62c602c23fa9:/app/soweego#
You are now in a BASH shell with a fully working soweego instance. Check if everything went fine with a shot of
python -m soweego
prod.sh
options¶
Option |
Expected value |
Default value |
Description |
---|---|---|---|
|
a directory path |
|
Directory shared between the soweego Docker container and your local filesystem |
|
a file path |
|
Credentials file |