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

chore:simpler deployment #869

Merged
merged 20 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# tileserver
TILE_SPRITES_URL=https://raw.githubusercontent.com/maputnik/osm-liberty/gh-pages/sprites

# database
POSTGRES_PASSWORD=CHANGE_ME
POSTGRES_USER=navigatum
POSTGRES_DB=navigatum

# feedback
GITHUB_TOKEN=CHANGE_ME
JWT_KEY=CHANGE_ME

# main api
MEILI_MASTER_KEY=CHANGE_ME
2 changes: 1 addition & 1 deletion .github/workflows/webclient-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: cypress-io/github-action@v5
with:
start: npm run dev
wait-on: "http://localhost:8000"
wait-on: "http://localhost:3000"
browser: ${{ matrix.browser }}
working-directory: webclient
webclient-linting:
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,25 @@ Note: The API is still under development, and we are open to Issues, Feature Req
NavigaTUM consists of three main parts + deployment resources.

Depending on what you want to work on, you **do not need to set up all of them**.
For an overview of how the components work, have a look at the
[deployment documentation](deployment/README.md).

- `data/` contains the code to obtain and process the data
- `server/` contains the APIs written in Rust
- `webclient/` contains a JS based web-frontend for the API
- `deployment/` contains deployment related configuration
- `map/` contains information about our own map, how to style it and how to run it

The following steps assume you have just cloned the repository and are in the root directory of it.
Let's go through them one by one, but first, you need to clone the repository:

```bash
git clone https://github.com/TUM-Dev/Navigatum.git
cd Navigatum
```

> [!NOTE]
> You can skip all the parts if you run `docker compose up --build` in the root of the repository
> and then open [http://localhost:3000](http://localhost:3000) in your browser.
> This will run the server, the data processing and the webclient in docker containers.
> Initial setup will take a while, as it needs to download maps data for the entire planet (~90GB).

### Data Processing

Expand All @@ -69,14 +78,7 @@ Else you can follow the steps in the [data documentation](data/README.md).
If you want to work on the webclient only (and not server or data), you don't need to set up the server. You can instead either use the public API (see the [webclient documentation](webclient/README.md#Testing)) or use our ready-made docker images to run the server locally:

```bash
docker network create navigatum-net
sudo rm -fr /tmp/navigatum/ && mkdir -p /tmp/navigatum/ && mkdir -p /tmp/navigatum/meili/ && mkdir -p /tmp/navigatum/server/

docker run -it --rm -v /tmp/navigatum/meili:/meili_data ghcr.io/tum-dev/navigatum-mieli-search-init:main
docker run -it --rm -p 7700:7700 --name search -v /tmp/navigatum/meili:/meili_data --network navigatum-net getmeili/meilisearch:latest

docker run -it --rm -v /tmp:/navigatum/server/ ghcr.io/tum-dev/navigatum-building-db-init:main
docker run -it --rm -p 8080:8080 --network navigatum-net -e API_SVC_SERVICE_HOST=search ghcr.io/tum-dev/navigatum-server:main /bin/navigatum-main-api
docker compose up --build
```

Else you can follow the steps in the [server documentation](server/README.md).
Expand Down
4 changes: 2 additions & 2 deletions data/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ RUN mkdir /cdn
COPY --from=build-stage /app/output /cdn
COPY nginx.conf /etc/nginx/nginx.conf

EXPOSE 8000
HEALTHCHECK CMD curl --fail localhost:8000/cdn/health || exit 1
EXPOSE 3002
HEALTHCHECK CMD curl --fail http://localhost:3002/cdn/health || exit 1
CMD ["nginx", "-g", "daemon off;"]
2 changes: 1 addition & 1 deletion data/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ http {

server {
# default_server makes nginx not care about HOST, we hande this upstream by Traefik
listen 8000 default_server;
listen 3002 default_server;
root /;

# compression configuration
Expand Down
1 change: 0 additions & 1 deletion deployment/ansible/.gitignore

This file was deleted.

43 changes: 0 additions & 43 deletions deployment/ansible/group_vars/all.yml

This file was deleted.

10 changes: 0 additions & 10 deletions deployment/ansible/hosts.ini

This file was deleted.

4 changes: 0 additions & 4 deletions deployment/ansible/roles/common/handlers/main.yml

This file was deleted.

18 changes: 0 additions & 18 deletions deployment/ansible/roles/common/tasks/_unatended_upgrades.yml

This file was deleted.

13 changes: 0 additions & 13 deletions deployment/ansible/roles/common/tasks/fail2ban.yml

This file was deleted.

46 changes: 0 additions & 46 deletions deployment/ansible/roles/common/tasks/main.yml

This file was deleted.

42 changes: 0 additions & 42 deletions deployment/ansible/roles/common/tasks/settings.yml

This file was deleted.

34 changes: 0 additions & 34 deletions deployment/ansible/roles/common/tasks/ssh.yml

This file was deleted.

16 changes: 0 additions & 16 deletions deployment/ansible/roles/common/tasks/ufw.yml

This file was deleted.

Loading
Loading