Skip to content

Commit

Permalink
Add tilt configs
Browse files Browse the repository at this point in the history
  • Loading branch information
m30m committed Feb 5, 2024
1 parent 5866cdb commit 163ef8f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ The updated enviornment variables can then be seen via `env`. We can then run th
pre-commit is a tool that checks and fixes simple issues (formatting, ...) before each commit. You can install it by following [their website](https://pre-commit.com/). In order to enable checks for this repo run `pre-commit install` from command-line in the root of this repo.

The checks are also performed in the CI to ensure the code follows consistent formatting.

### Development with Tilt

Run `tilt up --namespace dev-<YOUR_NAMESPACE>` to start tilt.
13 changes: 13 additions & 0 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
load('ext://configmap', 'configmap_create')
default_registry("192824654885.dkr.ecr.eu-west-2.amazonaws.com", single_name="development")
allow_k8s_contexts(["arn:aws:eks:eu-west-2:192824654885:cluster/violet"])
if k8s_namespace() == 'default':
fail("failing early to avoid deploying to 'default' namespace")

docker_build("server", ".",
only=["./auction-server", "./vault-simulator", "./per_multicall"],
ignore=["./auction-server/target", "./auction-server/config.yaml", "./vault-simulator/target", "./per_multicall/lib", "./per_multicall/node_modules"],
dockerfile="./Dockerfile")
k8s_yaml("./tilt/deployment.yaml")
configmap_create('auction-server-config', from_file=['config.yaml=./tilt/config.yaml'])
k8s_resource("per-server", port_forwards=["9000:9000"])
41 changes: 41 additions & 0 deletions tilt/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: per-server
spec:
selector:
matchLabels:
app: per-server
replicas: 1
template:
metadata:
labels:
app: per-server
spec:
containers:
- name: anvil
image: ghcr.io/foundry-rs/foundry:latest
command:
- /bin/sh
- -c
- "anvil --gas-limit 500000000000000000 --block-time 1"
- name: auction-server
image: server
command:
- /bin/sh
- -c
- "auction-server run"
volumeMounts:
- name: config-vol
mountPath: /config
readOnly: true
env:
# default first private key of anvil
- name: PER_PRIVATE_KEY
value: "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
- name: PER_CONFIG
value: /config/config.yaml
volumes:
- name: config-vol
configMap:
name: auction-server-config

0 comments on commit 163ef8f

Please sign in to comment.