Skip to content

Commit

Permalink
docs: added info about Rosetta i Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
roar-larsen committed Sep 28, 2023
1 parent 33dff13 commit 39e9467
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
- [Docker Compose](https://docs.docker.com/compose/)
- Make sure you have Python installed. version 3.11 or higher is required.

> **Tips:**
> If you are on a Mac you should enable `Rosetta` in Docker. Go to Settings -> Features in development. This will make the "reset-app" script run faster.
## Running (Mac / Linux)

> **Note**
Expand All @@ -18,46 +21,46 @@

The project uses yarn workspaces to handle dependencies for all three sub-projects.

- Run `yarn install`
- Run `yarn install`

#### Backend

Navigate to the `example` folder:
Navigate to the `example` folder:

- Initialize and activate virtual env
- `python3 -m venv .venv`
- `source .venv/bin/activate`
- Install dm-cli package by running `pip install -r requirements.txt`.
- Initialize and activate virtual env
- `python3 -m venv .venv`
- `source .venv/bin/activate`
- Install dm-cli package by running `pip install -r requirements.txt`.

2. Navigate to the root of the project, and build the local packages.
- Run `yarn build:dm-core && yarn build:dm-core-plugins`
3. Navigate to the `example` folder, then pull and start API services.
- Run `docker-compose pull && docker-compose up -d`
4. From the `example` folder, load data into the database.
- Run `./reset-app.sh`
5. Start the test app.
- Run `yarn start:example`
2. Navigate to the root of the project, and build the local packages.
- Run `yarn build:dm-core && yarn build:dm-core-plugins`
3. Navigate to the `example` folder, then pull and start API services.
- Run `docker-compose pull && docker-compose up -d`
4. From the `example` folder, load data into the database.
- Run `./reset-app.sh`
5. Start the test app.
- Run `yarn start:example`

## Running (Windows)

1. Open Powershell and navigate to dm-core-packages and run `yarn install`.
2. Navigate to dm-core-packages/example. Make sure docker engine is running, then run these commands:
- `docker-compose down && docker-compose pull && docker-compose up -d`
- `docker-compose run --rm dmss reset-app`
- `docker-compose run --rm job-api dm -u http://dmss:5000 reset ../app`
- `docker-compose down && docker-compose pull && docker-compose up -d`
- `docker-compose run --rm dmss reset-app`
- `docker-compose run --rm job-api dm -u http://dmss:5000 reset ../app`
3. Download and open WSL (windows subsystem for linux) terminal and navigate to c disk using the command: `cd /mnt/c`.
1. A useful tip is to download 'Windows Terminal' from the App Store, which is a useful terminal for switching
between WSL (Ubuntu) and powershell.
1. A useful tip is to download 'Windows Terminal' from the App Store, which is a useful terminal for switching
between WSL (Ubuntu) and powershell.
4. Make sure you have pip and venv installed in the WSL (Ubuntu) system.
```
sudo apt-get update &&
sudo apt-get upgrade &&
sudo apt-get upgrade &&
sudo apt install python3-pip &&
sudo apt install python3-venv
```
5. In the WSL terminal navigate to `dm-core-packages/example` and run
```
python3 -m venv .venv &&
python3 -m venv .venv &&
source .venv/bin/activate &&
pip install -r requirements.txt
```
Expand Down Expand Up @@ -92,4 +95,4 @@ The application watching and live-reload of dm-core dependencies, to turn this o
ALIAS=off yarn start
```

The configuration to support this hot reloading is in the `vite.local.config.ts` and `tsconfig.local.json`.
The configuration to support this hot reloading is in the `vite.local.config.ts` and `tsconfig.local.json`.

0 comments on commit 39e9467

Please sign in to comment.