-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
340 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,4 +57,5 @@ playground | |
moatless_testbeds.egg-info | ||
test_logs | ||
.ipynb_checkpoints | ||
__pycache__ | ||
__pycache__ | ||
.pypirc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
exec gunicorn --bind 0.0.0.0:8000 --workers 4 --timeout 30 --log-level info --capture-output --enable-stdio-inheritance "testbed.testbed.server:create_app()" | ||
exec gunicorn --bind 0.0.0.0:8000 --workers 4 --timeout 30 --log-level info --capture-output --enable-stdio-inheritance "testbeds.testbed.server:create_app()" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
annotations: | ||
cert-manager.io/cluster-issuer: letsencrypt-prod | ||
name: moatless-testbeds | ||
namespace: testbed-dev | ||
spec: | ||
ingressClassName: webapprouting.kubernetes.azure.com | ||
rules: | ||
- host: testbeds.moatless.ai | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: testbed-api-service | ||
port: | ||
number: 80 | ||
path: / | ||
pathType: Prefix | ||
tls: | ||
- hosts: | ||
- testbeds.moatless.ai | ||
secretName: moatless-testbeds-tls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[tool.poetry] | ||
name = "moatless-testbeds" | ||
version = "0.0.2" | ||
description = "Run testbeds as isolated pods in a Kubernetes cluster" | ||
authors = ["Albert Örwall <[email protected]>"] | ||
readme = "README.md" | ||
packages = [{include = "testbeds"}] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
requests = "^2.32.3" | ||
pydantic = "^2.8.2" | ||
datasets = "^3.0.2" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
#!/bin/bash | ||
|
||
DOCKER_IMAGE=${DOCKER_REGISTRY:-aorwall/moatless-testbed-api} | ||
NAMESPACE=${NAMESPACE:-default} | ||
export NAMESPACE=${KUBERNETES_NAMESPACE:-testbeds} | ||
export DOCKER_REGISTRY=${DOCKER_REGISTRY:-aorwall} | ||
export IMAGE_TAG=${IMAGE_TAG:-$(git rev-parse --short HEAD)} | ||
|
||
docker build -t ${DOCKER_IMAGE}:latest -f Dockerfile.api . | ||
docker push ${DOCKER_IMAGE}:latest | ||
echo "Deploying API to namespace: $NAMESPACE with image tag: $IMAGE_TAG" | ||
|
||
# Apply combined RBAC resources for API | ||
kubectl apply -f <(envsubst < infra/testbed-rbac.yaml) | ||
scripts/build_api.sh | ||
|
||
# Apply testbed sidecar service account and roles | ||
kubectl apply -f <(envsubst < infra/testbed-sa.yaml) | ||
kubectl apply -f <(envsubst < infra/testbed-role.yaml) | ||
kubectl apply -f <(envsubst < infra/testbed-rolebinding.yaml) | ||
|
||
kubectl apply -f <(envsubst < k8s/api-keys-secret.yaml) | ||
kubectl apply -f <(envsubst < k8s/api-deployment.yaml) | ||
kubectl apply -f <(envsubst < k8s/api-service.yaml) | ||
|
||
echo "Deployment completed in namespace: $NAMESPACE" | ||
echo "Deployment completed in namespace: $NAMESPACE with image tag: $IMAGE_TAG" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.