move ci/cd for services to mango-v4 repo

keeping only the scripts required for creating connector tgz
This commit is contained in:
GroovieGermanikus 2023-09-26 18:18:14 +02:00
parent c7a4ffa3fe
commit aecc83278c
9 changed files with 3 additions and 233 deletions

View File

@ -1,3 +0,0 @@
target
node_modules
dist

View File

@ -1,48 +0,0 @@
name: Publish Docker Image
on:
push:
branches:
- main
env:
IMAGE: mango-feeds
ORG: blockworks-foundation
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
# Use docker buildx
- name: Use docker buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
buildkitd-flags: --debug
# Login to Registry
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push the image
- name: Build and Push Image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@ -1,31 +0,0 @@
name: Deploy to Fly
on:
workflow_run:
workflows: ["Publish Docker Image"]
branches: [production]
types:
- completed
workflow_dispatch:
inputs:
imageTag:
description: 'Docker Image Tag'
required: true
type: string
default: 'latest'
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Fly
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy
run: flyctl deploy

View File

@ -1,26 +0,0 @@
# syntax = docker/dockerfile:1.2
# Base image containing all binaries, deployed to gcr.io/mango-markets/mango-geyser-services:latest
FROM rust:1.70.0-bullseye as base
RUN cargo install cargo-chef
RUN rustup component add rustfmt
RUN apt-get update && apt-get install -y clang cmake ssh
WORKDIR /app
FROM base AS plan
COPY . .
WORKDIR /app
RUN rustup show
RUN cargo chef prepare --recipe-path recipe.json
FROM base as build
COPY --from=plan /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN cargo build --release --bin service-mango-fills --bin service-mango-pnl --bin service-mango-orderbook
FROM debian:bullseye-slim as run
RUN apt-get update && apt-get -y install ca-certificates libc6
COPY --from=build /app/target/release/service-mango-* /usr/local/bin/
COPY --from=build /app/service-mango-pnl/conf/template-config.toml ./pnl-config.toml
COPY --from=build /app/service-mango-fills/conf/template-config.toml ./fills-config.toml
COPY --from=build /app/service-mango-orderbook/conf/template-config.toml ./orderbook-config.toml

View File

@ -1,22 +1,9 @@
# mango-geyser-services
# mango-feeds-connector
Mango v4 Geyser Services
Solana Websocket and Geyser Services
# Components
- [`lib/`](lib/)
- [`connector/`](connector/)
Tools for building services
- [`service-mango-fills/`](service-mango-fills/)
A service providing lowest-latency, bandwidth conserving access to fill events for Mango V4 Perp and Openbook markets
as they are processed by the rpc node.
- [`service-mango-pnl/`](service-mango-pnl/)
A service providing pre-computed account lists ordered by unsettled PnL per market
- [`service-mango-orderbook/`](service-mango-pnl/)
A service providing Orderbook L2/L3 state and delta updates for Mango V4 Perp and Openbook Spot markets

View File

@ -1,23 +0,0 @@
app = "mango-fills"
kill_signal = "SIGTERM"
kill_timeout = 30
[build]
dockerfile = "../Dockerfile"
[experimental]
cmd = ["service-mango-fills", "fills-config.toml"]
[[services]]
internal_port = 8080
processes = ["app"]
protocol = "tcp"
[services.concurrency]
hard_limit = 1024
soft_limit = 1024
type = "connections"
[metrics]
path = "/metrics"
port = 9091

View File

@ -1,23 +0,0 @@
app = "mango-orderbook"
kill_signal = "SIGINT"
kill_timeout = 5
[build]
dockerfile = "../Dockerfile"
[experimental]
cmd = ["service-mango-orderbook", "orderbook-config.toml"]
[[services]]
internal_port = 8080
processes = ["app"]
protocol = "tcp"
[services.concurrency]
hard_limit = 1024
soft_limit = 1024
type = "connections"
[metrics]
path = "/metrics"
port = 9091

View File

@ -1,23 +0,0 @@
app = "mango-pnl"
kill_signal = "SIGINT"
kill_timeout = 5
[build]
dockerfile = "../Dockerfile"
[experimental]
cmd = ["service-mango-pnl", "pnl-config.toml"]
[[services]]
internal_port = 8081
processes = ["app"]
protocol = "tcp"
[services.concurrency]
hard_limit = 1024
soft_limit = 1024
type = "connections"
[metrics]
path = "/metrics"
port = 9091

View File

@ -1,40 +0,0 @@
app = "mango-geyser-services"
kill_signal = "SIGINT"
kill_timeout = 5
[processes]
fills = "service-mango-fills fills-config.toml"
orderbook = "service-mango-orderbook orderbook-config.toml"
[[services]]
processes = ["fills"]
internal_port = 8080
protocol = "tcp"
[[services.ports]]
handlers = ["tls", "http"]
port = "8080"
[services.concurrency]
type = "connections"
hard_limit = 1024
soft_limit = 1024
[[services]]
processes = ["orderbook"]
internal_port = 8082
protocol = "tcp"
[[services.ports]]
handlers = ["tls", "http"]
port = "8082"
[services.concurrency]
type = "connections"
hard_limit = 1024
soft_limit = 1024
[metrics]
port = 9091
path = "/metrics"