Skip to content

Commit

Permalink
add use the docker to execute scripts in jl
Browse files Browse the repository at this point in the history
  • Loading branch information
jfilhoGN committed Dec 16, 2024
1 parent 779f5c8 commit 5e3d879
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ results = Stressify.run_test(
```
---

## 📦 Using Stressify with Docker

To run Stressify without installing anything locally, use Docker:

```bash
docker pull jfilhogn/stressify:latest
docker run --rm jfilhogn/stressify:latest script.jl
```

Running the docker image this way will execute the script you want to run, making it easier to execute. In the directory `./docker` you can find the Dockerfile and the script.jl file that is used to run the image as example.

## 🛠 Usage

### Example Test Script
Expand Down
9 changes: 9 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM julia:1.11

WORKDIR /app

COPY . .

RUN julia -e 'using Pkg; Pkg.add("Stressify")'

CMD ["julia", "--project=."]
14 changes: 14 additions & 0 deletions docker/firstTestDocker.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Pkg
Pkg.activate(".")
using Stressify

#execute for the one VU for one iteration
Stressify.options(
vus = 1,
iterations = 1,
duration = nothing
)

results = Stressify.run_test(
Stressify.http_get("https://httpbin.org/get"),
)
13 changes: 13 additions & 0 deletions docs/source/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ The output will be a dictionary with the following structure:
---------- Resultados dos Checks ----------
Using Docker to execute Stressify
=================================

To run Stressify without installing anything locally, use Docker:

.. code-block:: bash
docker pull jfilhogn/stressify:latest
docker run --rm jfilhogn/stressify:latest script.jl
Running the docker image this way will execute the script you want to run, making it easier to execute. In the directory `./docker` you can find the Dockerfile and the script.jl file that is used to run the image as example.

Important Links
-------------------

Expand Down

0 comments on commit 5e3d879

Please sign in to comment.