Skip to content

Commit

Permalink
Add playground make target. (#125)
Browse files Browse the repository at this point in the history
* Add playground make target.

* Add playground make target.

* Add links to the playground installation instructions.

* Update index.html

* Update to Ubuntu Lateset for CI workflows.
  • Loading branch information
gavinleroy authored Feb 21, 2024
1 parent b681fe0 commit cd3f0e8
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
jobs:
test-authentication:
if: contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Ping remote
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:

build-backend:
needs: [check-publishable-versions,test-authentication]
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and save docker image
Expand All @@ -70,7 +70,7 @@ jobs:

update-frontend:
needs: build-backend
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
AQUASCOPE_SERVER: "https://aquascope.willcrichton.net"
steps:
Expand All @@ -90,7 +90,7 @@ jobs:

update-server:
needs: update-frontend
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restart server
Expand All @@ -103,7 +103,7 @@ jobs:

publish-crates:
needs: [update-frontend,update-server]
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

release-artifact:
needs: tag
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
steps:
- uses: actions/checkout@v3
Expand Down
17 changes: 14 additions & 3 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,22 @@ mkdir -p frontend/packages/aquascope-editor/src/bindings
cp crates/**/bindings/* frontend/packages/aquascope-editor/src/bindings
"""

[tasks.install-mdbook]
[tasks.install-aquascope]
dependencies = ["init-bindings"]
script = """
cd frontend && depot build && cd ..
cargo miri setup
cargo install --path crates/mdbook-aquascope --locked
cargo install --path crates/aquascope_front --locked
"""
"""

[tasks.install-mdbook]
dependencies = ["install-aquascope"]
script = "cargo install --path crates/mdbook-aquascope --locked"

[tasks.playground-front]
script = "cd frontend && depot build -w"

[tasks.playground.run_task]
dependencies = ["install-aquascope"]
name = ["watch-server", "playground-front"]
parallel = true
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ Then add an Aquascope code block to one of your Markdown source files like this:

Further documentation on the syntax and configuration of Aquascope blocks will be provided once the interface is more stable.

### Local Playground

Running the provided [playground](https://cognitive-engineering-lab.github.io/aquascope/) locally is also easy. First, you'll need to follow the above *from source* installation instructions. Then, you can launch the server by running `cargo make playground` and navigate to [`localhost:5173`](http://localhost:5173/) to explore.

> Note, the local playground **does not** run the tool within a sandbox. This makes the local version quicker, but don't run any malicious programs.
<!--
### Available visualizations
Expand Down Expand Up @@ -188,4 +194,4 @@ Visualizing permission steps can be quite intrusive but oftentimes you may want

## Having trouble?

If you want to use Aquascope but are having trouble finding the relevant information, please leave an issue or email us at <[email protected]> and <gagray@ethz.ch>.
If you want to use Aquascope but are having trouble finding the relevant information, please leave an issue or email us at <[email protected]> and <gavin.gray@inf.ethz.ch>.
7 changes: 7 additions & 0 deletions frontend/packages/aquascope-standalone/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ <h1>Aquascope Playground</h1>
If you want to see Aquascope diagrams in action, check out the new chapter on ownership in the
<a href="https://rust-book.cs.brown.edu/ch04-01-what-is-ownership.html">Rust Book Experiment</a>.
</p>

<p>
You can easily install and run the Aquascope playground locally. Simply follow the
<a href="https://github.com/cognitive-engineering-lab/aquascope?tab=readme-ov-file#local-playground">installation instructions</a>.
Running the playground locally is faster, which can improve demos in front of a live audience. It's also an option if our server is down, and please
<a href="https://github.com/cognitive-engineering-lab/aquascope/issues/new">file an issue</a> if it is.
</p>

<div class="columns">
<div class="tabs-container">
Expand Down

0 comments on commit cd3f0e8

Please sign in to comment.