Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

Commit 0ea92d6

Browse files
authored
Add CI job for building local artifacts and update documentation (#27)
* feat: add build-local-artifacts job to CI workflow and update dist configuration * chore: keep docs updated * chore: one last nit
1 parent ebb8c65 commit 0ea92d6

File tree

7 files changed

+88
-43
lines changed

7 files changed

+88
-43
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 🔍 CI
1+
name: CI
22

33
on:
44
push:

.github/workflows/release.yml

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,88 @@ jobs:
8686
name: artifacts-plan-dist-manifest
8787
path: plan-dist-manifest.json
8888

89+
# Build and packages all the platform-specific things
90+
build-local-artifacts:
91+
name: build-local-artifacts (${{ join(matrix.targets, ', ') }})
92+
# Let the initial task tell us to not run (currently very blunt)
93+
needs:
94+
- plan
95+
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
96+
strategy:
97+
fail-fast: false
98+
# Target platforms/runners are computed by dist in create-release.
99+
# Each member of the matrix has the following arguments:
100+
#
101+
# - runner: the github runner
102+
# - dist-args: cli flags to pass to dist
103+
# - install-dist: expression to run to install dist on the runner
104+
#
105+
# Typically there will be:
106+
# - 1 "global" task that builds universal installers
107+
# - N "local" tasks that build each platform's binaries and platform-specific installers
108+
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
109+
runs-on: ${{ matrix.runner }}
110+
container: ${{ matrix.container && matrix.container.image || null }}
111+
env:
112+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113+
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
114+
steps:
115+
- name: enable windows longpaths
116+
run: |
117+
git config --global core.longpaths true
118+
- uses: actions/checkout@v4
119+
with:
120+
submodules: recursive
121+
- name: Install Rust non-interactively if not already installed
122+
if: ${{ matrix.container }}
123+
run: |
124+
if ! command -v cargo > /dev/null 2>&1; then
125+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
126+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
127+
fi
128+
- name: Install dist
129+
run: ${{ matrix.install_dist.run }}
130+
# Get the dist-manifest
131+
- name: Fetch local artifacts
132+
uses: actions/download-artifact@v4
133+
with:
134+
pattern: artifacts-*
135+
path: target/distrib/
136+
merge-multiple: true
137+
- name: Install dependencies
138+
run: |
139+
${{ matrix.packages_install }}
140+
- name: Build artifacts
141+
run: |
142+
# Actually do builds and make zips and whatnot
143+
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
144+
echo "dist ran successfully"
145+
- id: cargo-dist
146+
name: Post-build
147+
# We force bash here just because github makes it really hard to get values up
148+
# to "real" actions without writing to env-vars, and writing to env-vars has
149+
# inconsistent syntax between shell and powershell.
150+
shell: bash
151+
run: |
152+
# Parse out what we just built and upload it to scratch storage
153+
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
154+
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
155+
echo "EOF" >> "$GITHUB_OUTPUT"
156+
157+
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
158+
- name: "Upload artifacts"
159+
uses: actions/upload-artifact@v4
160+
with:
161+
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
162+
path: |
163+
${{ steps.cargo-dist.outputs.paths }}
164+
${{ env.BUILD_MANIFEST_NAME }}
165+
89166
# Build and package all the platform-agnostic(ish) things
90167
build-global-artifacts:
91168
needs:
92169
- plan
170+
- build-local-artifacts
93171
runs-on: "ubuntu-latest"
94172
env:
95173
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -134,9 +212,10 @@ jobs:
134212
host:
135213
needs:
136214
- plan
215+
- build-local-artifacts
137216
- build-global-artifacts
138217
# Only run if we're "publishing", and only if local and global didn't fail (skipped is fine)
139-
if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') }}
218+
if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
140219
env:
141220
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142221
runs-on: "ubuntu-latest"

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "rce-engine"
33
version = "1.2.6"
44
authors = ["ToolKitHub"]
5-
description = "HTTP API for running untrusted code inside isolated Docker containers."
5+
description = "A secure service for running untrusted code inside isolated Docker containers via a simple HTTP API"
66
homepage = "https://github.com/ToolKitHub/rce-engine?tab=readme-ov-file#readme"
77
repository = "https://github.com/ToolKitHub/rce-engine"
88
edition = "2024"

README.md

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# rce-engine
1+
# RCE Engine
22

3-
**rce-engine** is a secure service for running untrusted code inside isolated Docker containers via a simple HTTP API. Execute code in 41 different programming languages with strong security guarantees.
3+
RCE Engine is a secure service for running untrusted code inside isolated Docker containers via a simple HTTP API. See [supported languages](https://github.com/ToolKitHub/rce-runner)
44

55
[View full documentation](DOCUMENTATION.md)
66

@@ -51,45 +51,13 @@ Response:
5151
}
5252
```
5353

54-
## Supported Languages
55-
56-
rce-engine currently supports these 41 programming languages:
57-
58-
| Languages A-G | Languages G-N | Languages O-Z |
59-
|---------------|---------------|---------------|
60-
| Assembly | Go | OCaml |
61-
| ATS | Groovy | Perl |
62-
| Bash | Haskell | PHP |
63-
| C | Idris | Python |
64-
| C++ | Java | Raku |
65-
| C# | JavaScript | Ruby |
66-
| Clojure | Julia | Rust |
67-
| COBOL | Kotlin | Scala |
68-
| CoffeeScript | Lua | Swift |
69-
| Crystal | Mercury | TypeScript |
70-
| D | Nim | |
71-
| Dart | | |
72-
| Elixir | | |
73-
| Elm | | |
74-
| Erlang | | |
75-
| F# | | |
76-
77-
Don't see your language? [Open an issue](https://github.com/toolkithub/rce-engine/issues) and we'll consider adding it. New language support is continuously being added based on user demand.
78-
7954
## Documentation
8055

8156
- [Full documentation](DOCUMENTATION.md)
8257
- [API Reference](docs/api/run.md)
8358
- [Installation guides](docs/install/)
8459

85-
## Security
86-
87-
rce-engine is designed with security in mind:
88-
- Fresh container for each execution
89-
- Container destroyed after completion
90-
- Resource limits to prevent abuse
91-
- Optional gVisor runtime for enhanced isolation
9260

9361
## License
9462

95-
[See License](./LICENSE)
63+
See [License](./LICENSE)

dist-workspace.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
1515
install-path = "CARGO_HOME"
1616
# Whether to install an updater program
1717
install-updater = true
18-
# Whether CI should include auto-generated code to build local artifacts
19-
build-local-artifacts = false
2018

2119
[dist.github-custom-runners]
2220
global = "ubuntu-latest"
21+
x86_64-unknown-linux-gnu = "ubuntu-latest"

docs/api/run.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ The `/run` endpoint is the core of the rce-engine API, allowing you to execute c
66

77
- **URL**: `/run`
88
- **Method**: `POST`
9-
- **Required Headers**:
10-
- `X-Access-Token`: Your
9+
- **Required Headers**:
1110
- `X-Access-Token`: Your API access token (set in server configuration)
1211
- `Content-Type`: `application/json`
1312

scripts/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
# RCE engine test script - Run code in multiple language containers
33
set -eo pipefail
44

0 commit comments

Comments
 (0)