Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]
types: [labeled, synchronize]

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -76,7 +77,7 @@ jobs:
with:
context: .
file: ${{ matrix.dockerfile }}
push: ${{ (github.event_name != 'pull_request' || startsWith(github.head_ref, 'ci/') || inputs.push) && 'true' || 'false' }}
push: ${{ (github.event_name != 'pull_request' || startsWith(github.head_ref, 'ci/') || inputs.push || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'docker-push'))) && 'true' || 'false' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
working-directory: deployment

- name: Run CRS
run: make deploy-local
run: make deploy

- name: Submit custom task to the CRS
if: github.event_name == 'workflow_dispatch'
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Thank you for contributing to the Buttercup Cyber Reasoning System!
git clone --recurse-submodules https://github.com/trailofbits/buttercup.git
cd buttercup
make setup-local # Automated setup
make deploy-local # Start environment
make deploy # Start environment

# Setup development tools (optional but recommended)
pip install pre-commit
Expand Down Expand Up @@ -50,7 +50,7 @@ make undeploy # Clean up resources

3. **Full System** (90+ min): Weekly or with `full-integration` label
```bash
make deploy-local && make send-libpng-task
make deploy && make send-libpng-task
```

## Project Structure
Expand Down
42 changes: 12 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile for Trail of Bits AIxCC Finals CRS

.PHONY: help setup-local setup-azure validate deploy deploy-local deploy-azure test undeploy install-cscope lint lint-component clean-local wait-crs check-crs crs-instance-id status send-integration-task
.PHONY: help setup-local setup-azure validate deploy test undeploy install-cscope lint lint-component clean-local wait-crs check-crs crs-instance-id status send-integration-task

# Default target
help:
Expand All @@ -13,8 +13,6 @@ help:
@echo ""
@echo "Deployment:"
@echo " deploy - Deploy to current environment (local or azure)"
@echo " deploy-local - Deploy to local Minikube environment"
@echo " deploy-azure - Deploy to production AKS environment"
@echo ""
@echo "Status:"
@echo " status - Check the status of the deployment"
Expand Down Expand Up @@ -48,16 +46,6 @@ validate:
@echo "Validating setup..."
./scripts/validate-setup.sh

# Deployment targets
deploy:
@echo "Deploying to current environment..."
@if [ ! -f external/buttercup-cscope/configure.ac ]; then \
echo "Error: The git submodules have not been initialized. Run 'git submodule update --init --recursive' first."; \
exit 1; \
fi
cd deployment && make up
make wait-crs

wait-crs:
@echo "Waiting for CRS deployment to be ready..."
@if ! kubectl get namespace $${BUTTERCUP_NAMESPACE:-crs} >/dev/null 2>&1; then \
Expand Down Expand Up @@ -96,8 +84,8 @@ crs-instance-id:
fi
echo "CRS instance ID: $$(kubectl get configmap -n $${BUTTERCUP_NAMESPACE:-crs} crs-instance-id -o jsonpath='{.data.crs-instance-id}')"

deploy-local:
@echo "Deploying to local Minikube environment..."
deploy:
@echo "Deploying environment..."
@if [ ! -f deployment/env ]; then \
echo "Error: Configuration file not found. Run 'make setup-local' first."; \
exit 1; \
Expand All @@ -106,25 +94,19 @@ deploy-local:
echo "Error: The git submodules have not been initialized. Run 'git submodule update --init --recursive' first."; \
exit 1; \
fi
cd deployment && make up
make crs-instance-id
make wait-crs

deploy-azure:
@echo "Deploying to production AKS environment..."
@if [ ! -f deployment/env ]; then \
echo "Error: Configuration file not found. Run 'make setup-azure' first."; \
exit 1; \
fi
@if [ ! -f external/buttercup-cscope/configure.ac ]; then \
echo "Error: The git submodules have not been initialized. Run 'git submodule update --init --recursive' first."; \
@echo "Deployment configuration:"
@grep 'CLUSTER_TYPE=' deployment/env || echo "CLUSTER_TYPE not set"
@grep 'K8S_VALUES_TEMPLATE' deployment/env || echo "K8S_VALUES_TEMPLATE not set"
@echo "Are you sure you want to deploy with these settings? Type 'yes' to continue:"
@read ans; \
ans_lc=$$(echo "$$ans" | tr '[:upper:]' '[:lower:]'); \
if [ "$$ans_lc" != "yes" ] && [ "$$ans_lc" != "y" ]; then \
echo "Aborted by user."; \
exit 1; \
fi
cd deployment && make up
crs_instance_id=$$(make crs-instance-id)
echo "CRS instance ID: $$crs_instance_id"
make crs-instance-id
make wait-crs

status:
@echo "----------PODS------------"
@kubectl get pods -n $${BUTTERCUP_NAMESPACE:-crs}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

**Note:** Buttercup uses third-party AI providers (LLMs from companies like OpenAI, Anthropic and Google), which cost money. Please ensure that you manage per-deployment costs by using the built-in LLM budget setting.

**Note:** Buttercup works best with access to models from OpenAI **and** Anthropic, but can be run with at least one API key from one third-party provider (support for Gemini coming soon).
**Note:** Buttercup works best with access to models from OpenAI **and** Anthropic, but can be run with at least one API key from one third-party provider. You can a combination of OpenAI, Anthropic, and Google LLMs.

### Supported Systems

Expand Down Expand Up @@ -78,7 +78,7 @@ This script will install all dependencies, configure the environment, and guide
1. Start Buttercup locally

```bash
make deploy-local
make deploy
```

1. Verify local deployment:
Expand Down
5 changes: 5 additions & 0 deletions deployment/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions deployment/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Microsoft.Compute
- Microsoft.Storage
- Microsoft.Network
- Microsoft.ContainerService

2. Verify and adjust Azure quotas:
- Total Regional vCPUs: ~2000
Expand Down
1 change: 1 addition & 0 deletions deployment/env.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export CLUSTER_TYPE=minikube # or "aks"
# export TF_VAR_ARM_SUBSCRIPTION_ID="<your-sub-id>"
# export TF_VAR_usr_node_count=50
# export TF_VAR_resource_group_name_prefix="<resource-prefix>"
# export TF_VAR_resource_group_name="<existing-resource-group-name>"

# TailScale variables, necessary only for production/staging deployments
export TAILSCALE_ENABLED=false # or true
Expand Down
Loading