Skip to content

Commit acdf3c7

Browse files
authored
Merge pull request #714 from integer32llc/timeout-metrics
2 parents 3f5e9c9 + 4b2355c commit acdf3c7

File tree

8 files changed

+699
-59
lines changed

8 files changed

+699
-59
lines changed

deployment/update.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
33
set -euv -o pipefail
44

55
root=/home/ubuntu
6+
binary_path=$root/playground-artifacts/ui
67

78
# Get new docker images
89
$root/rust-playground/compiler/fetch.sh
910

1011
# Clean old docker images
1112
docker system prune -f || true
1213

14+
# Get the binary's hash so we know if it has changed
15+
previous_binary_hash=""
16+
if [[ -f "${binary_path}" ]]; then
17+
previous_binary_hash=$(md5sum "${binary_path}")
18+
fi
19+
1320
# Get new artifacts
1421
aws s3 sync --region=us-east-2 s3://playground-artifacts-i32 $root/playground-artifacts
1522
# These artifacts don't change names and might stay the same size
@@ -23,8 +30,10 @@ aws s3 sync \
2330
--include=build/robots.txt \
2431
--exact-timestamps \
2532
s3://playground-artifacts-i32 $root/playground-artifacts
26-
chmod +x $root/playground-artifacts/ui
33+
chmod +x "${binary_path}"
2734

2835
# Restart to get new server binary
29-
sudo service playground stop || true
30-
sudo service playground start
36+
if [[ -z "${previous_binary_hash}" ]] || ! md5sum -c <(echo "${previous_binary_hash}") --status; then
37+
sudo service playground stop || true
38+
sudo service playground start
39+
fi

tests/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ GEM
1818
diff-lcs (1.4.4)
1919
launchy (2.5.0)
2020
addressable (~> 2.7)
21-
mini_mime (1.0.3)
22-
mini_portile2 (2.5.0)
23-
nokogiri (1.11.2)
21+
mini_mime (1.1.0)
22+
mini_portile2 (2.5.1)
23+
nokogiri (1.11.3)
2424
mini_portile2 (~> 2.5.0)
2525
racc (~> 1.4)
2626
public_suffix (4.0.6)

tests/spec/features/compilation_targets_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@
9090
in_build_menu { click_on("MIR") }
9191

9292
within(:output, :result) do
93-
expect(page).to have_content 'StorageLive'
94-
expect(page).to have_content 'StorageDead'
93+
expect(page).to have_content 'bb0: {'
9594
end
9695
end
9796

ui/Cargo.lock

Lines changed: 134 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ router = "0.6.0"
2929
openssl-probe = "0.1.2"
3030
dotenv = "0.15.0"
3131
snafu = "0.6.0"
32+
prometheus = "0.12.0"
33+
strum = { version = "0.20.0", features = ["derive"] }
3234

3335
[dependencies.playground-middleware]
3436
git = "https://github.com/integer32llc/playground-middleware"

ui/README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ disk in this directory.
66
In production, these should be set according to your deployment method
77
of choice.
88

9-
| Key | Required | Default Value | Description |
10-
| --------------------------|----------|-----------------|-------------------------------------------------------------------------|
11-
| `PLAYGROUND_UI_ROOT` | **Yes** | | The path to the HTML, CSS, and Javascript files |
12-
| `PLAYGROUND_GITHUB_TOKEN` | **Yes** | | The [GitHub API token][gist] to read and write Gists |
13-
| `PLAYGROUND_UI_ADDRESS` | No | 127.0.0.1 | The address to listen on |
14-
| `PLAYGROUND_UI_PORT` | No | 5000 | The port to listen on |
15-
| `PLAYGROUND_LOG_FILE` | No | access-log.csv | The file to record accesses |
16-
| `PLAYGROUND_CORS_ENABLED` | No | | If set, will enable CORS support |
17-
| `TMPDIR` | No | system-provided | Where compilation artifacts will be saved. Must be accessible to Docker |
9+
| Key | Required | Default Value | Description |
10+
| -------------------------- | ---------- | ----------------- | ------------------------------------------------------------------------- |
11+
| `PLAYGROUND_UI_ROOT` | **Yes** | | The path to the HTML, CSS, and Javascript files |
12+
| `PLAYGROUND_GITHUB_TOKEN` | **Yes** | | The [GitHub API token][gist] to read and write Gists |
13+
| `PLAYGROUND_UI_ADDRESS` | No | 127.0.0.1 | The address to listen on |
14+
| `PLAYGROUND_UI_PORT` | No | 5000 | The port to listen on |
15+
| `PLAYGROUND_LOG_FILE` | No | access-log.csv | The file to record accesses |
16+
| `PLAYGROUND_METRICS_TOKEN` | No | | If set, will require authentication for the metrics endpoint |
17+
| `PLAYGROUND_CORS_ENABLED` | No | | If set, will enable CORS support |
18+
| `TMPDIR` | No | system-provided | Where compilation artifacts will be saved. Must be accessible to Docker |
1819

1920
[dotenv]: https://crates.io/crates/dotenv
2021
[gist]: https://developer.github.com/v3/gists/#authentication

0 commit comments

Comments
 (0)