Skip to content

Commit

Permalink
Update xmtplib Docker scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieobject committed Feb 24, 2024
1 parent a5f20e2 commit fcec575
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 25 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ jobs:

- name: Install docker
run: brew install colima docker docker-compose

- name: Start colima
run: colima start

- name: Start local test server
run: docker-compose -p xmtp -f dev/local/docker-compose.yml up -d

- name: Start Docker containers
run: dev/up

# - name: Start local test server
# run: docker-compose -p xmtp -f dev/local/docker-compose.yml up -d

# - name: Test with xcodebuild
# run: xcodebuild test -scheme XMTP -destination "platform=iOS Simulator,name=iPhone 14"
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/xmtp/libxmtp-swift",
"state" : {
"revision" : "de859c86a5854bdc2cfd54e8f98b6088a38a2f3c",
"version" : "0.4.2-beta2"
"revision" : "28ee27a4ded8b996a74850e366247e9fe51d782a",
"version" : "0.4.2-beta4"
}
},
{
Expand Down
4 changes: 4 additions & 0 deletions dev/local/compose
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -eou pipefail

docker-compose -f dev/local/docker-compose.yml -p "xmtp-android" "$@"
34 changes: 16 additions & 18 deletions dev/local/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: "3.8"
services:
wakunode:
node:
image: xmtp/node-go:latest
platform: linux/amd64
environment:
Expand All @@ -9,28 +8,27 @@ services:
- --store.enable
- --store.db-connection-string=postgres://postgres:xmtp@db:5432/postgres?sslmode=disable
- --store.reader-db-connection-string=postgres://postgres:xmtp@db:5432/postgres?sslmode=disable
- --mls-store.db-connection-string=postgres://postgres:xmtp@mlsdb:5432/postgres?sslmode=disable
- --mls-validation.grpc-address=validation:50051
- --api.enable-mls
- --wait-for-db=30s
- --api.authn.enable
ports:
- 9001:9001
- 5555:5555 # http message API
- 5556:5556 # grpc message API
- 5555:5555
- 5556:5556
depends_on:
- db
healthcheck:
test: [ "CMD", "lsof", "-i", ":5556" ]
interval: 3s
timeout: 10s
retries: 5

validation:
image: ghcr.io/xmtp/mls-validation-service:main
platform: linux/amd64

db:
image: postgres:13
environment:
POSTGRES_PASSWORD: xmtp
js:
restart: always
platform: linux/amd64
depends_on:
wakunode:
condition: service_healthy
build: ./../test


mlsdb:
image: postgres:13
environment:
POSTGRES_PASSWORD: xmtp
1 change: 1 addition & 0 deletions dev/test/Dockerfile → dev/local/test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ FROM node:19-alpine

WORKDIR /code
ADD script.js script.js
RUN apk update && apk add git
RUN npm install @xmtp/xmtp-js ethers
CMD ["node", "script.js"]
2 changes: 1 addition & 1 deletion dev/test/script.js → dev/local/test/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ async function checkAll() {
}
}

checkAll().then(() => console.log("Done"));
checkAll().then(() => console.log("Done"));
6 changes: 6 additions & 0 deletions dev/local/up
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -eou pipefail
script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

"${script_dir}"/compose pull
"${script_dir}"/compose up -d --build
18 changes: 18 additions & 0 deletions dev/up
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -eou pipefail

if [[ "${OSTYPE}" == "darwin"* ]]; then
if ! which buf &>/dev/null; then brew install buf; fi
if ! which shellcheck &>/dev/null; then brew install shellcheck; fi
if ! which markdownlint &>/dev/null; then brew install markdownlint-cli; fi
if ! java -version &>/dev/null; then
brew install java
sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk \
/Library/Java/JavaVirtualMachines/
fi
if ! kotlinc -version &>/dev/null; then brew install kotlin; fi
fi

rustup update

dev/local/up

0 comments on commit fcec575

Please sign in to comment.