Skip to content

Commit

Permalink
Update more README commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-quintero committed Sep 10, 2024
1 parent be983a6 commit 6ff0ead
Show file tree
Hide file tree
Showing 29 changed files with 129 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .nextmv/golden/go-hello-world/inputs/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "world"
}
5 changes: 5 additions & 0 deletions .nextmv/golden/go-hello-world/inputs/input.json.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"statistics": {
"message": "Hello, world"
}
}
34 changes: 34 additions & 0 deletions .nextmv/golden/go-hello-world/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package mip

import (
"os"
"testing"

"github.com/nextmv-io/sdk/golden"
)

func TestMain(m *testing.M) {
code := m.Run()
os.Exit(code)
}

func TestGolden(t *testing.T) {
golden.FileTests(
t,
"inputs",
golden.Config{
Args: []string{},
TransientFields: []golden.TransientField{},
Thresholds: golden.Tresholds{
Float: 0.01,
},
ExecutionConfig: &golden.ExecutionConfig{
Command: "go",
Args: []string{"run", "."},
InputFlag: "-runner.input.path",
OutputFlag: "-runner.output.path",
WorkDir: "../../../go-hello-world",
},
},
)
}
1 change: 1 addition & 0 deletions .nextmv/readme/go-hello-world/0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cat input.json | go run .
1 change: 1 addition & 0 deletions .nextmv/readme/go-hello-world/0.sh.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"options":{},"solution":{},"statistics":{"message":"Hello, world"}}
1 change: 1 addition & 0 deletions .nextmv/readme/java-hello-world/0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mvn package
Empty file.
1 change: 1 addition & 0 deletions .nextmv/readme/java-hello-world/1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cat input.json | java -jar main.jar
1 change: 1 addition & 0 deletions .nextmv/readme/java-hello-world/1.sh.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"options":{},"solution":{},"statistics":{"message":"Hello, world"}}
2 changes: 1 addition & 1 deletion .nextmv/readme/python-ampl-knapsack/1.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python3 main.py -input input.json -output output.json \
-duration 30 -provider cbc
-duration 30 -provider highs
2 changes: 1 addition & 1 deletion .nextmv/readme/python-hello-world/1.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
echo '{"name":"world"}' | python3 main.py
cat input.json | python3 main.py
3 changes: 2 additions & 1 deletion .nextmv/readme/python-ortools-costflow/1.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python3 main.py -input input.json -output output.json
python3 main.py -input input.json -output output.json \
-duration 30 -penalty 3000
3 changes: 2 additions & 1 deletion .nextmv/readme/python-ortools-demandforecasting/1.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python3 main.py -input input.json -output output.json -duration 30
python3 main.py -input input.json -output output.json \
-duration 30 -penalty 3000
20 changes: 20 additions & 0 deletions .nextmv/readme/python-ortools-knapsack-multicsv/0.sh.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Requirement already satisfied: ortools==9.8.3296 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from -r requirements.txt (line 1)) (9.8.3296)
Requirement already satisfied: nextmv==VERSION.dev0 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from -r requirements.txt (line 2)) (0.10.3.dev0)
Requirement already satisfied: absl-py>=2.0.0 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from ortools==9.8.3296->-r requirements.txt (line 1)) (2.1.0)
Requirement already satisfied: numpy>=1.13.3 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from ortools==9.8.3296->-r requirements.txt (line 1)) (1.26.4)
Requirement already satisfied: pandas>=2.0.0 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from ortools==9.8.3296->-r requirements.txt (line 1)) (2.2.2)
Requirement already satisfied: protobuf>=4.25.0 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from ortools==9.8.3296->-r requirements.txt (line 1)) (4.25.3)
Requirement already satisfied: pydantic>=2.5.2 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from nextmv==VERSION.dev0->-r requirements.txt (line 2)) (2.6.1)
Requirement already satisfied: pyyaml>=6.0.1 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from nextmv==VERSION.dev0->-r requirements.txt (line 2)) (6.0.2)
Requirement already satisfied: requests>=2.31.0 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from nextmv==VERSION.dev0->-r requirements.txt (line 2)) (2.31.0)
Requirement already satisfied: urllib3>=2.1.0 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from nextmv==VERSION.dev0->-r requirements.txt (line 2)) (2.2.2)
Requirement already satisfied: python-dateutil>=2.8.2 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from pandas>=2.0.0->ortools==9.8.3296->-r requirements.txt (line 1)) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from pandas>=2.0.0->ortools==9.8.3296->-r requirements.txt (line 1)) (2024.1)
Requirement already satisfied: tzdata>=2022.7 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from pandas>=2.0.0->ortools==9.8.3296->-r requirements.txt (line 1)) (2024.1)
Requirement already satisfied: annotated-types>=0.4.0 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from pydantic>=2.5.2->nextmv==VERSION.dev0->-r requirements.txt (line 2)) (0.6.0)
Requirement already satisfied: pydantic-core==2.16.2 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from pydantic>=2.5.2->nextmv==VERSION.dev0->-r requirements.txt (line 2)) (2.16.2)
Requirement already satisfied: typing-extensions>=4.6.1 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from pydantic>=2.5.2->nextmv==VERSION.dev0->-r requirements.txt (line 2)) (4.9.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from requests>=2.31.0->nextmv==VERSION.dev0->-r requirements.txt (line 2)) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from requests>=2.31.0->nextmv==VERSION.dev0->-r requirements.txt (line 2)) (3.6)
Requirement already satisfied: certifi>=2017.4.17 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from requests>=2.31.0->nextmv==VERSION.dev0->-r requirements.txt (line 2)) (2024.2.2)
Requirement already satisfied: six>=1.5 in /Users/sebastian-quintero/github/community-apps/venv/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas>=2.0.0->ortools==9.8.3296->-r requirements.txt (line 1)) (1.16.0)
2 changes: 1 addition & 1 deletion .nextmv/readme/python-ortools-knapsack-multicsv/1.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python3 main.py -duration 30
python3 main.py -input input -output output -duration 30 -provider SCIP
4 changes: 2 additions & 2 deletions .nextmv/readme/python-ortools-knapsack-multicsv/1.sh.golden
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"options": {
"input": "",
"output": "",
"input": "input",
"output": "output",
"duration": 30,
"provider": "SCIP"
},
Expand Down
23 changes: 23 additions & 0 deletions .nextmv/readme/python-ortools-knapsack-multicsv/2.sh.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"options": {
"input": "",
"output": "",
"duration": 30,
"provider": "SCIP"
},
"statistics": {
"run": {
"duration": 0.123
},
"result": {
"duration": 0.123,
"value": 444.0,
"custom": {
"status": "optimal",
"variables": 11,
"constraints": 1
}
},
"schema": "v1"
}
}
3 changes: 2 additions & 1 deletion .nextmv/readme/python-ortools-knapsack/1.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python3 main.py -input inputs/input.json -output output.json -duration 30
python3 main.py -input inputs/input.json -output output.json \
-duration 30 -provider SCIP
3 changes: 2 additions & 1 deletion .nextmv/readme/python-ortools-shiftassignment/1.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python3 main.py -input input.json -output output.json -duration 30
python3 main.py -input input.json -output output.json \
-duration 30 -provider SCIP
3 changes: 2 additions & 1 deletion .nextmv/readme/python-ortools-shiftplanning/1.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python3 main.py -input input.json -output output.json -duration 30
python3 main.py -input input.json -output output.json \
-duration 30 -provider SCIP
3 changes: 2 additions & 1 deletion .nextmv/readme/python-pyomo-shiftassignment/1.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python3 main.py -input input.json -output output.json -duration 30
python3 main.py -input input.json -output output.json \
-duration 30 -provider cbc
3 changes: 2 additions & 1 deletion .nextmv/readme/python-pyomo-shiftplanning/1.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python3 main.py -input input.json -output output.json -duration 30
python3 main.py -input input.json -output output.json \
-duration 30 -provider cbc
3 changes: 2 additions & 1 deletion .nextmv/readme/python-pyvroom-routing/1.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python3 main.py -input input.json -output output.json -duration 30
python3 main.py -input input.json -output output.json \
-duration 30 -exploration_level 4 -threads 6
4 changes: 2 additions & 2 deletions .nextmv/readme/python-pyvroom-routing/2.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cat input.json | docker run -i --rm \
-v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \
sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py'
-v $(pwd):/app ghcr.io/nextmv-io/runtime/pyomo:latest \
sh -c 'python3 /app/main.py'
12 changes: 12 additions & 0 deletions .nextmv/readme/workflow-configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,24 @@ apps:
silent: true
- name: 1.sh
skip: true
- name: java-hello-world
scripts:
- name: 0.sh
silent: true
- name: 2.sh
skip: true
- name: java-ortools-knapsack
scripts:
- name: 0.sh
silent: true
- name: 2.sh
skip: true
- name: java-ortools-routing
scripts:
- name: 0.sh
silent: true
- name: 2.sh
skip: true
- name: python-ampl-facilitylocation
scripts:
- name: 0.sh
Expand Down
2 changes: 1 addition & 1 deletion python-ortools-costflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ projects.
1. Run the app.

```bash
python3 main.py -input inputs/input.json -output output.json \
python3 main.py -input input.json -output output.json \
-duration 30 -penalty 3000
```

Expand Down
2 changes: 1 addition & 1 deletion python-ortools-demandforecasting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ historical demands by time to forecast a given demand in the future.
1. Run the app.

```bash
python3 main.py -input inputs/input.json -output output.json \
python3 main.py -input input.json -output output.json \
-duration 30 -penalty 3000
```

Expand Down
2 changes: 1 addition & 1 deletion python-ortools-routing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ OR-Tools package. We solve a vehicle routing problem.
1. Run the app.

```bash
python3 main.py -input inputs/input.json -output output.json -duration 30
python3 main.py -input input.json -output output.json -duration 30
```

## Next steps
Expand Down
2 changes: 1 addition & 1 deletion python-pyvroom-routing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Pyvroom package. We solve a vehicle routing problem.
1. Run the app.

```bash
python3 main.py -input inputs/input.json -output output.json \
python3 main.py -input input.json -output output.json \
-duration 30 -exploration_level 4 -threads 6
```

Expand Down

0 comments on commit 6ff0ead

Please sign in to comment.