diff --git a/.gitignore b/.gitignore index 7d8e063b..b6cf28b5 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ result* **/.DS_Store /crates/maelstrom-web/target /**/__pycache__ +/website2/public diff --git a/package.nix b/package.nix index 8cbb24a6..9e64cb7a 100644 --- a/package.nix +++ b/package.nix @@ -13,6 +13,7 @@ python311Packages, mypy, black, + zola, version ? null }: @@ -56,6 +57,7 @@ let python311Packages.types-protobuf python311Packages.xdg-base-dirs mdbook + zola ]; buildInputs = [ openssl ] ++ optionals stdenv.isDarwin [ libiconv ]; diff --git a/website2/config.toml b/website2/config.toml new file mode 100644 index 00000000..04e0f9a8 --- /dev/null +++ b/website2/config.toml @@ -0,0 +1,16 @@ +# The URL the site will be built for +base_url = "https://maelstrom-software.com" + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = true + +# Whether to build a search index to be used later on by a JavaScript library +build_search_index = false + +[markdown] +# Whether to do syntax highlighting +# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola +highlight_code = false + +[extra] +# Put all your custom variables here diff --git a/website2/content/blog/_index.md b/website2/content/blog/_index.md new file mode 100644 index 00000000..76ca26ca --- /dev/null +++ b/website2/content/blog/_index.md @@ -0,0 +1,6 @@ ++++ +title = "The Maelstrom Blog" +sort_by = "date" +template = "blog.html" +page_template = "blog-page.html" ++++ diff --git a/website2/content/blog/first.md b/website2/content/blog/first.md new file mode 100644 index 00000000..2941df6b --- /dev/null +++ b/website2/content/blog/first.md @@ -0,0 +1,8 @@ ++++ +title = "My first post" +date = 2019-11-27 ++++ + +This is some blog content. + +This is the rest of the content. diff --git a/website2/content/blog/second.md b/website2/content/blog/second.md new file mode 100644 index 00000000..b696995a --- /dev/null +++ b/website2/content/blog/second.md @@ -0,0 +1,8 @@ ++++ +title = "My second post" +date = 2020-11-27 ++++ + +This is some blog content. + +This is the rest of the content. diff --git a/website2/static/assets b/website2/static/assets new file mode 120000 index 00000000..da286240 --- /dev/null +++ b/website2/static/assets @@ -0,0 +1 @@ +../../website/assets \ No newline at end of file diff --git a/website2/static/images b/website2/static/images new file mode 120000 index 00000000..375d357b --- /dev/null +++ b/website2/static/images @@ -0,0 +1 @@ +../../website/images \ No newline at end of file diff --git a/website2/templates/base.html b/website2/templates/base.html new file mode 100644 index 00000000..0705591c --- /dev/null +++ b/website2/templates/base.html @@ -0,0 +1,87 @@ + + + + + + Maelstrom Software + + + + + + +
+ + +
+ + + {% block hero %} {% endblock %} + +
+ + +
+
+ + +
+ {% block content %} {% endblock %} +
+
+
+ + + + +
+ + + + + + + + + + + + diff --git a/website2/templates/blog-page.html b/website2/templates/blog-page.html new file mode 100644 index 00000000..f0f638e9 --- /dev/null +++ b/website2/templates/blog-page.html @@ -0,0 +1,9 @@ +{% extends "base.html" %} + +{% block content %} +

+ {{ page.title }} +

+

{{ page.date }}

+{{ page.content | safe }} +{% endblock content %} diff --git a/website2/templates/blog.html b/website2/templates/blog.html new file mode 100644 index 00000000..f69fb575 --- /dev/null +++ b/website2/templates/blog.html @@ -0,0 +1,41 @@ +{% extends "base.html" %} + +{% block content %} + + +
+
+ +
+
+

{{ section.title }}

+

Maelstrom packages your Rust tests into hermetic micro-containers, then schedules + and distributes them amongst an arbitrarily large cluster of test-runners.

+
+ +
+
+
+ +
+
+
+ {% for page in section.pages %} +
+
+ +
+
+

{{ page.title }}

+
+ {{ page.summary | safe }} + +
+ {% endfor %} +
+
+
+ +{% endblock content %} diff --git a/website2/templates/index.html b/website2/templates/index.html new file mode 100644 index 00000000..6967c28d --- /dev/null +++ b/website2/templates/index.html @@ -0,0 +1,230 @@ +{% extends "base.html" %} + +{% block hero %} + +
+
+

A clustered, hermetic test runner. +

+

Maelstrom is a test runner for Rust and Pytest, built on top of a general-purpose clustered job engine.

+ +
+{% endblock hero %} + +{% block content %} +
+

About Maelstrom

+
+ +

+ Maelstrom packages your tests into hermetic micro-containers, + then distributes them to be run on an arbitrarily large cluster + of test-runners, or locally on your machine. You might use + Maelstrom to run your tests because: +

+ + + + + +

+ Maelstrom is currently available for Rust and Pytest on Linux. + C++, Typescript, and Java are coming soon. +

+ +

+ While our focus thus far has been on running tests, Maelstrom's + underlying job execution system is general-purpose. We provide + a command line utility to run arbitrary commands, as well a + gRPC-based API and Rust bindings for programmatic access and + control. +

+ +

See the book for more information:

+ + + + + + +
+
+ +
+
+ + +
+
+ + +
+
+

Getting Started

+
+

Installing Pre-Built Binaries

+

+ To run your tests using Maelstrom, you need a test-runner binary. + The easiest way to get it is using cargo-binstall. +

+ +

For Rust tests:

+ +cargo binstall cargo-maelstrom + +

+ +

For Python tests:

+cargo binstall maelstrom-pytest +

+ This will install a pre-built binary from the github + releases page. If you don't have cargo-binstall, + you can download the binary manually. +

+

+ Check out the + book for more ways to install Maelstrom. +

+ +

Running cargo-maelstrom

+ +

To run your Rust tests, use cargo-maelstrom:

+ +cargo maelstrom +

+ +

+ This runs in "standalone" mode, meaning all tests are run + locally. Each test is run in its own container, configured with a + few common dependencies. It may work for your project without any + further configuration. +

+ +

+ If some tests fail, however, it likely means those tests have + dependencies on their execution environment that aren't packaged + in their containers. You can remedy this by adding directives to + the cargo-maelstrom.toml file. To do this, run: +

+cargo maelstrom --init +

+

+ Then edit the created cargo-maelstrom.toml file as + described + in the book. +

+

+ +

Running maelstrom-pytest

+

Before running tests, we need to do a little setup.

+

Choosing a Python Image

+

First, generate a maelstrom-pytest.toml file

+maelstrom-pytest --init +

Then update the file to include a python image.

+[[directives]]
+image.name="docker://python:3.11-slim"
+image.use = ["layers", "environment"] +

+ This example installs an image from Docker. +

+

Including Your Project Python Files

+

+ So that your tests can be run from the container, your project's + python must be included. +

+added_layers = [ { glob = "**.py" } ] +

+ This example just adds all files with a .py extension. + You may also need to include .pyi files or other + files. +

+

Including pip Packages

+

+ If you have an image named "python", maelstrom-pytest + will automatically include pip packages for you as part of the + container. It expects to read these packages from a + test-requirements.txt file in your project directory. This needs + to at a minimum include the pytest package + test-requirements.txt. +

+pytest==8.1.1 +

Now we are ready to try to run tests. Just invoke maelstrom-pytest:

+maelstrom-pytest +

+ This runs in "standalone" mode, meaning all tests are run + locally. Each test is run in its own container. +

+ +

Setting Up a Cluster

+

+ To get even more out of Maelstrom, you can set up a cluster to + run your tests on. You will need to run one copy of the broker + (maelstrom-broker) somewhere, and one copy of the worker + (maelstrom-worker) on each node of the cluster. +

+

+ You can install these using + multiple methods, including cargo-binstall: +

+cargo binstall maelstrom-worker maelstrom-broker +

+

Then you can start the broker:

+maelstrom-broker --port=1234 +

+

Then a few workers:

+maelstrom-worker --broker=broker-host:1234 +

+

Then run cargo-maelstrom against the cluster:

+cargo maelstrom --broker=broker-host:1234 +

+

See the book for more information:

+ +{% endblock content %}