Add a stack for running Osmosis frontend app on Urbit #683

Merged
prathamesh0 merged 8 commits from ng-osmosis-urbit into main 2023-12-14 11:58:10 +00:00
12 changed files with 40 additions and 97 deletions
Showing only changes of commit 1627246782 - Show all commits

View File

@ -10,10 +10,7 @@ services:
command: ["./build-app.sh"]
volumes:
- ../config/osmosis/build-app.sh:/app/packages/web/build-app.sh
- urbit_app_builds:/app-builds
# TODO: Refactor common mar files
- ../config/osmosis/urbit-files/mar:/app/packages/web/mar
- ../config/osmosis/urbit-files/desk.docket-0:/app/packages/web/desk.docket-0
- app_builds:/app-builds
nginx:
image: nginx:1.23-alpine
@ -23,7 +20,7 @@ services:
condition: service_completed_successfully
volumes:
- ../config/osmosis/nginx:/etc/nginx/conf.d
- urbit_app_builds:/app-builds
- app_builds:/app-builds
ports:
- "80"
healthcheck:
@ -34,4 +31,4 @@ services:
start_period: 5s
volumes:
urbit_app_builds:
app_builds:

View File

@ -16,6 +16,3 @@ yarn build:static
# Move build to app-builds
mkdir -p /app-builds/osmosis
cp -r ./out /app-builds/osmosis/build
cp -r mar /app-builds/osmosis/
cp desk.docket-0 /app-builds/osmosis/

View File

@ -0,0 +1,12 @@
|_ dat=@
++ grow
|%
++ mime [/image/x-icon (as-octs:mimes:html dat)]
--
++ grab
|%
++ mime |=([p=mite q=octs] q.q)
++ noun @
--
++ grad %mime
--

View File

@ -0,0 +1,12 @@
|_ dat=@
++ grow
|%
++ mime [/image/jpeg (as-octs:mimes:html dat)]
--
++ grab
|%
++ mime |=([p=mite q=octs] q.q)
++ noun @
--
++ grad %mime
--

View File

@ -1,12 +0,0 @@
|_ dat=octs
++ grow
|%
++ mime [/font/ttf dat]
--
++ grab
|%
++ mime |=([=mite =octs] octs)
++ noun octs
--
++ grad %mime
--

View File

@ -0,0 +1,12 @@
|_ dat=@
++ grow
|%
++ mime [/image/webp (as-octs:mimes:html dat)]
--
++ grab
|%
++ mime |=([p=mite q=octs] q.q)
++ noun @
--
++ grad %mime
--

View File

@ -1,12 +0,0 @@
|_ dat=octs
++ grow
|%
++ mime [/font/woff dat]
--
++ grab
|%
++ mime |=([=mite =octs] octs)
++ noun octs
--
++ grad %mime
--

View File

@ -1,7 +0,0 @@
FROM python:3.13.0a2-alpine3.18
RUN apk --update --no-cache add alpine-sdk jq bash curl wget
WORKDIR /app
ENTRYPOINT [ "bash" ]

View File

@ -1,9 +0,0 @@
#!/usr/bin/env bash
# Build the urbit-globs-host image
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
# See: https://stackoverflow.com/a/246128/1701505
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
docker build -t cerc/urbit-globs-host:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${SCRIPT_DIR}

View File

@ -3,10 +3,7 @@
Instructions to build and deploy:
- Self-hosted gitea
- An ipfs node
- Urbit
- The osmosis front end
- Hosted on python server
- Deployed on urbit
- A laconicd chain
## Setup
@ -43,8 +40,6 @@ Edit `network` in spec file to map container ports to same ports in host
...
network:
ports:
urbit-fake-ship:
- '8080:80'
proxy-server:
- '4000:4000'
nginx:
@ -73,9 +68,6 @@ Inside the deployment directory, open the file `config.env` and set the followin
(Note: Following config can be used as is if the stack is being run locally)
```bash
# App to be installed (Do not change)
CERC_URBIT_APP=osmosis
# Osmosis API base URL
# Set this to proxy server endpoint for osmosis app
# (Eg. http://localhost:4000 - in case stack is being run locally with proxy enabled)
@ -84,10 +76,6 @@ Inside the deployment directory, open the file `config.env` and set the followin
# Optional
# Whether to enable app installation on Urbit
# (just builds and uploads the glob file if disabled) (Default: true)
CERC_ENABLE_APP_INSTALL=
# Whether to run the proxy server
# (Disable only if proxy not required to be run) (Default: true)
CERC_ENABLE_PROXY=
@ -97,16 +85,6 @@ Inside the deployment directory, open the file `config.env` and set the followin
# Upstream API URL
CERC_PROXY_UPSTREAM=https://app.osmosis.zone
# IPFS configuration
# IFPS endpoint to host the glob file on
# (Default: http://ipfs-glob-host:5001 pointing to in-stack IPFS node)
CERC_IPFS_GLOB_HOST_ENDPOINT=
# IFPS endpoint to fetch the glob file from
# (Default: http://ipfs-glob-host:8080 pointing to in-stack IPFS node)
CERC_IPFS_SERVER_ENDPOINT=
```
## Start the stack
@ -127,27 +105,6 @@ laconic-so deployment --dir osmosis-deployment start
* The web app can be accessed at http://localhost:3000
* Run the following to get login password for Urbit web interface:
```bash
laconic-so deployment --dir osmosis-deployment exec urbit-fake-ship "curl -s --data '{\"source\":{\"dojo\":\"+code\"},\"sink\":{\"stdout\":null}}' http://localhost:12321"
# Expected output: "<PASSWORD>\n"%
```
* Open the Urbit web UI at http://localhost:8080 and use the `PASSWORD` from previous step to login
* The osmosis app is not available when starting stack for the first time. Check `urbit-fake-ship` logs to see that app has installed
```
laconic-so deployment --dir osmosis-deployment logs -f
# Expected output:
# laconic-3ccf7ee79bdae874-urbit-fake-ship-1 | docket: fetching %http glob for %uniswap desk
# laconic-3ccf7ee79bdae874-urbit-fake-ship-1 | ">="">="Osmosis app installed
```
* The osmosis app will be now visible at http://localhost:8080
## Laconic registry
Setup a test chain:

View File

@ -12,13 +12,10 @@ containers:
# - cerc/act-runner-task-executor
- cerc/watcher-ts
- cerc/osmosis-front-end
- cerc/urbit-globs-host
pods:
# - kubo
- proxy-server
- osmosis-front-end
- fixturenet-urbit
# TODO: Use kubo instead of ipfs in fixturenet-urbit pod
# - 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

View File

@ -6,7 +6,6 @@ repos:
containers:
- cerc/uniswap-interface
- cerc/watcher-ts
- cerc/urbit-globs-host
pods:
- uniswap-interface
- proxy-server