Skip to content

Commit

Permalink
Update osmosis frontend stack to serve app
Browse files Browse the repository at this point in the history
  • Loading branch information
nikugogoi committed Dec 6, 2023
1 parent 1dbbb2b commit 163d612
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ services:
image: cerc/osmosis-front-end:local
restart: always
ports:
- "3002:3002" #TODO make `3000` when using the deployment feature
- "3000"
healthcheck:
test: ["CMD", "nc", "-vz", "localhost", "3000"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
93 changes: 83 additions & 10 deletions stack_orchestrator/data/stacks/osmosis/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,74 @@
# self-hosted osmosis

Build and deploy:
- 1) self-hosted gitea,
- 2) an ipfs node,
- 3) the osmosis front end,
- 4) a laconicd chain
Instructions to build and deploy:
- self-hosted gitea
- an ipfs node
- the osmosis front end
- a laconicd chain

## Setup

Clone required repositories:

```bash
laconic-so --stack osmosis setup-repositories

# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories and re-run the command
```

Build the container images:

```
# support image for the gitea package registry
laconic-so --stack build-support build-containers
# todo: pre-run clone
# clones and builds several things
laconic-so --stack osmosis setup-repositories
laconic-so --stack osmosis build-containers
laconic-so --stack osmosis deploy up
```

## Create a deployment

First, create a spec file for the deployment, which will map the stack's ports and volumes to the host:
```bash
laconic-so --stack osmosis deploy init --output osmosis-spec.yml
```

### Ports

Edit `network` in spec file to map container ports to same ports in host

```
...
ports:
osmosis-front-end:
- '3000:3000'
ipfs:
- 0.0.0.0:8080:8080
- 0.0.0.0:4001:4001
- 0.0.0.0:5001:5001
```

### Data volumes
Container data volumes are bind-mounted to specified paths in the host filesystem.
The default setup (generated by `laconic-so deploy init`) places the volumes in the `./data` subdirectory of the deployment directory. The default mappings can be customized by editing the "spec" file generated by `laconic-so deploy init`.

---

Once you've made any needed changes to the spec file, create a deployment from it:
```bash
laconic-so --stack osmosis deploy create --spec-file osmosis-spec.yml --deployment-dir osmosis-deployment
```

## Start the stack

Start the deployment:
```bash
laconic-so deployment --dir osmosis-deployment start
```

* List and check the health status of all the containers using `docker ps` and wait for them to be `healthy`

## Laconic registry

Setup a test chain:
```
export CERC_NPM_REGISTRY_URL=https://git.vdb.to/api/packages/cerc-io/npm/
Expand All @@ -33,3 +83,26 @@ laconic-so --stack fixturenet-laconic-loaded deploy up
```

then `docker exec` into the `laconicd` container and either export the private key or create a new one and send funds to it. Use that private key for `LACONIC_HOTWALLET_KEY`.

## Clean up

To stop all osmosis services running in the background, while preserving chain data:

```bash
laconic-so deployment --dir osmosis-deployment stop
```

To stop all osmosis services and also delete data:

```bash
laconic-so deployment --dir osmosis-deployment stop --delete-volumes
```

To stop stack running Laconic registry

```bash
laconic-so --stack fixturenet-laconic-loaded deploy down

# Delete volumes
laconic-so --stack fixturenet-laconic-loaded deploy down --delete-volumes
```
28 changes: 14 additions & 14 deletions stack_orchestrator/data/stacks/osmosis/stack.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
version: "0.1"
name: osmosis
repos:
# these are for gitea
# For gitea
- git.vdb.to/cerc-io/hosting@names-for-so
- gitea.com/gitea/act_runner
# add the osmosis FE
# For osmosis frontend
- github.com/osmosis-labs/osmosis-frontend
containers:
- cerc/act-runner
- cerc/act-runner-task-executor
# note: osmosis builds but doesn't run
- cerc/osmosis-front-end
pods:
- name: gitea
repository: cerc-io/hosting
path: gitea
pre_start_command: "run-this-first.sh"
post_start_command: "initialize-gitea.sh"
# todo, e.g., mirroring all of osmosis repos: https://git.vdb.to/cerc-io/hosting/pulls/42
- name: act-runner
repository: cerc-io/hosting
path: act-runner
pre_start_command: "pre_start.sh"
post_start_command: "post_start.sh"
- osmosis-front-end
- kubo
# TODO: Fix pod config for deployment command
# TODO: mirroring all of osmosis repos: https://git.vdb.to/cerc-io/hosting/pulls/42
# - name: gitea
# repository: cerc-io/hosting
# path: gitea
# pre_start_command: "run-this-first.sh"
# post_start_command: "initialize-gitea.sh"
# - name: act-runner
# repository: cerc-io/hosting
# path: act-runner
# pre_start_command: "pre_start.sh"
# post_start_command: "post_start.sh"

0 comments on commit 163d612

Please sign in to comment.