Skip to content

Commit ba2d4c6

Browse files
committed
Add robotrumble exec build insts; use REPO_DIR for logs parent
1 parent 4182ec9 commit ba2d4c6

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

codeclash/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from pathlib import Path
22

3-
from codeclash import PACKAGE_DIR
3+
from codeclash import REPO_DIR
44

55
DIR_LOGS = Path("logs") # this is used also for parts of the paths in the environment
6-
LOCAL_LOG_DIR = PACKAGE_DIR / DIR_LOGS # this one is always relative to the location of this code
6+
LOCAL_LOG_DIR = REPO_DIR / DIR_LOGS # this one is always relative to the location of this code
77
DIR_WORK = Path("/testbed")
88
FILE_RESULTS = "results.json"
99
GH_ORG = "emagedoc"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# RobotRumble
2+
3+
* Website: https://robotrumble.org/
4+
* GitHub: https://github.com/robot-rumble/
5+
6+
### To rebuild `./robotrumble` executable from scratch
7+
From within a dockerfile...
8+
```dockerfile
9+
# Ensure awscli is installed w/ apt-get
10+
RUN apt-get update && apt-get install -y awscli curl
11+
12+
# Install Rust via rustup
13+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y \
14+
&& . "$HOME/.cargo/env" \
15+
&& echo 'source $HOME/.cargo/env' >> /etc/bash.bashrc
16+
ENV PATH="/root/.cargo/bin:${PATH}"
17+
18+
# Use a newer toolchain required by deps, and default to it
19+
RUN rustup toolchain install 1.82.0 && rustup default 1.82.0
20+
21+
# Force Cargo to use system linker (gcc) instead of rust-lld
22+
RUN mkdir -p /root/.cargo \
23+
&& printf '[target.x86_64-unknown-linux-gnu]\nlinker = "cc"\n' > /root/.cargo/config.toml
24+
25+
# Clone the repo... (OMITTED)
26+
27+
# Pull public S3 assets
28+
RUN cd /testbed/cli && aws --no-sign-request s3 sync s3://rr-public-assets/lang-runners ../logic/wasm-dist/lang-runners
29+
RUN cd /testbed/cli && aws --no-sign-request s3 sync s3://rr-public-assets/cli-assets dist/
30+
31+
# Build without updating deps; use Cargo.lock as-is
32+
RUN cd /testbed/cli && cargo build --locked --release
33+
34+
# Place the built binary at /testbed/rumblebot
35+
RUN install -Dm755 /testbed/cli/target/release/rumblebot /testbed/rumblebot
36+
37+
# Remove some unnecessary bloat
38+
RUN rm -rf /testbed/cli/target
39+
40+
# Remove rust toolchains & caches
41+
RUN rm -rf /root/.cargo /root/.rustup /root/.cache \
42+
&& sed -i '/source \$HOME\/\.cargo\/env/d' /etc/bash.bashrc || true \
43+
&& true
44+
```

0 commit comments

Comments
 (0)