├── .github └── workflows │ ├── go-lint.yml │ ├── golden.yml │ ├── json-lint.yml │ ├── markdown-lint.yml │ ├── python-lint.yml │ ├── readme-test.yml │ ├── release.yml │ └── static.yml ├── .gitignore ├── .golangci.yml ├── .nextmv ├── golden │ ├── README.md │ ├── go-hello-world │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── go-highs-knapsack │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── go-highs-orderfulfillment │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── go-highs-shiftscheduling │ │ ├── inputs │ │ │ ├── input.json │ │ │ ├── input.json.golden │ │ │ ├── input2.json │ │ │ └── input2.json.golden │ │ └── main_test.go │ ├── go-nextroute │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── go.mod │ ├── go.sum │ ├── java-ortools-knapsack │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-ampl-facilitylocation │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-ampl-knapsack │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-ampl-priceoptimization │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-gurobi-knapsack │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-hello-world │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-highs-knapsack │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-nextmv-gurobipy-knapsack │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-nextroute │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-ortools-costflow │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-ortools-demandforecasting │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-ortools-knapsack │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-ortools-region-allocation │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-ortools-routing │ │ ├── inputs │ │ │ ├── both-matrices.json │ │ │ ├── both-matrices.json.golden │ │ │ ├── both-matrices.md │ │ │ ├── distance-matrix.json │ │ │ ├── distance-matrix.json.golden │ │ │ ├── distance-matrix.md │ │ │ ├── max-duration.json │ │ │ ├── max-duration.json.golden │ │ │ ├── max-duration.md │ │ │ ├── no-matrix.json │ │ │ ├── no-matrix.json.golden │ │ │ └── no-matrix.md │ │ └── main_test.go │ ├── python-ortools-shiftassignment │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-ortools-shiftplanning │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-pyomo-knapsack │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ ├── main_test.go │ │ └── setup.sh │ ├── python-pyomo-shiftassignment │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ ├── main_test.go │ │ └── setup.sh │ ├── python-pyomo-shiftplanning │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ ├── main_test.go │ │ └── setup.sh │ ├── python-pyoptinterface-knapsack │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ ├── python-pyvroom-routing │ │ ├── inputs │ │ │ ├── both-matrices.json │ │ │ ├── both-matrices.json.golden │ │ │ ├── both-matrices.md │ │ │ ├── distance-matrix.json │ │ │ ├── distance-matrix.json.golden │ │ │ ├── distance-matrix.md │ │ │ ├── max-duration.json │ │ │ ├── max-duration.json.golden │ │ │ ├── max-duration.md │ │ │ ├── no-matrix.json │ │ │ ├── no-matrix.json.golden │ │ │ └── no-matrix.md │ │ └── main_test.go │ ├── python-xpress-knapsack │ │ ├── inputs │ │ │ ├── input.json │ │ │ └── input.json.golden │ │ └── main_test.go │ └── workflow-configuration.yml ├── readme │ ├── README.md │ ├── go-hello-world │ │ ├── 0.sh │ │ └── 0.sh.golden │ ├── go-highs-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ └── 1.sh │ ├── go-highs-orderfulfillment │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ └── 1.sh │ ├── go-highs-shiftscheduling │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ └── 1.sh │ ├── go-nextroute │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ └── 1.sh │ ├── go.mod │ ├── go.sum │ ├── java-gurobi-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 2.sh │ │ └── 3.sh │ ├── java-hello-world │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ └── 1.sh.golden │ ├── java-hexaly-knapsack │ │ ├── 0.sh │ │ ├── 1.sh │ │ ├── 2.sh │ │ └── 3.sh │ ├── java-ortools-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── java-ortools-routing │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── main_test.go │ ├── python-ampl-facilitylocation │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ ├── 2.sh │ │ └── 2.sh.golden │ ├── python-ampl-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-ampl-priceoptimization │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ ├── 2.sh │ │ └── 2.sh.golden │ ├── python-gurobi-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-hello-world │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-hexaly-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ └── 2.sh │ ├── python-highs-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-nextmv-gurobipy-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-nextroute │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ └── 1.sh.golden │ ├── python-ortools-costflow │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-ortools-demandforecasting │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-ortools-knapsack-multicsv │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-ortools-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-ortools-region-allocation │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-ortools-routing │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-ortools-shiftassignment │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-ortools-shiftplanning │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-pyomo-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-pyomo-shiftassignment │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-pyomo-shiftplanning │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-pyoptinterface-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-pyvroom-routing │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ ├── 2.sh │ │ └── 2.sh.golden │ ├── python-tr-ortools-region-allocation │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── python-wf-databricks-ml-gurobi-price-optimization │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ └── 2.sh │ ├── python-wf-databricks │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ └── 2.sh │ ├── python-wf-ortools-region-allocation │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 2.sh │ │ ├── 2.sh.golden │ │ ├── 3.sh │ │ ├── 4.sh │ │ ├── 5.sh │ │ └── 6.sh │ ├── python-xpress-knapsack │ │ ├── 0.sh │ │ ├── 0.sh.golden │ │ ├── 1.sh │ │ ├── 1.sh.golden │ │ └── 2.sh │ ├── readme-extract-commands.py │ └── workflow-configuration.yml ├── release │ ├── README.md │ ├── log.py │ ├── main.py │ ├── manifest.py │ ├── push_app.sh │ ├── requirements.txt │ └── workflow_configuration.py └── workflow-configuration.yml ├── .prettierrc.yml ├── README.md ├── go-hello-world ├── LICENSE ├── README.md ├── app.yaml ├── go.mod ├── go.sum ├── input.json └── main.go ├── go-highs-knapsack ├── LICENSE ├── README.md ├── app.yaml ├── go.mod ├── go.sum ├── input.json └── main.go ├── go-highs-orderfulfillment ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── app.yaml ├── go-highs.code-workspace ├── go.mod ├── go.sum ├── input.json └── main.go ├── go-highs-shiftscheduling ├── LICENSE ├── README.md ├── app.yaml ├── go.mod ├── go.sum ├── input.json ├── main.go └── schema.go ├── go-nextroute ├── LICENSE ├── README.md ├── app.yaml ├── go.mod ├── go.sum ├── input.json └── main.go ├── java-gurobi-knapsack ├── .devcontainer │ └── devcontainer.json ├── .gitignore ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── java-gurobi-knapsack.code-workspace ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── nextmv │ └── example │ ├── Input.java │ ├── Item.java │ ├── Main.java │ ├── Options.java │ └── Output.java ├── java-hello-world ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── nextmv │ └── example │ └── Main.java ├── java-hexaly-knapsack ├── .devcontainer │ └── devcontainer.json ├── .gitignore ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── java-hexaly-knapsack.code-workspace ├── lib │ └── .keep ├── local │ └── .keep ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── nextmv │ └── example │ ├── Input.java │ ├── Item.java │ ├── Main.java │ ├── Options.java │ └── Output.java ├── java-ortools-knapsack ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── java-ortools.code-workspace ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── nextmv │ └── example │ ├── Input.java │ ├── Item.java │ ├── Main.java │ ├── Options.java │ └── Output.java ├── java-ortools-routing ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── java-ortools.code-workspace ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── nextmv │ └── example │ ├── Input.java │ ├── Main.java │ ├── Options.java │ ├── Output.java │ └── Vehicle.java ├── python-ampl-facilitylocation ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── ampl_license_uuid.template ├── app.yaml ├── floc_bend.mod ├── floc_bend.run ├── input.json ├── main.py ├── python-ampl.code-workspace └── requirements.txt ├── python-ampl-knapsack ├── LICENSE ├── README.md ├── ampl_license_uuid.template ├── app.yaml ├── input.json ├── main.py └── requirements.txt ├── python-ampl-priceoptimization ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── ampl_license_uuid.template ├── ampl_model.mod ├── app.yaml ├── input.json ├── main.py ├── python-ampl.code-workspace ├── requirements.txt └── visuals.py ├── python-gurobi-knapsack ├── LICENSE ├── README.md ├── app.yaml ├── gurobi.lic.template ├── input.json ├── main.ipynb ├── main.py └── requirements.txt ├── python-gurobi-price-optimization ├── LICENSE ├── README.md └── main.ipynb ├── python-hello-world ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py ├── requirements.txt └── visuals.py ├── python-hexaly-knapsack ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── license.dat.template ├── main.py └── requirements.txt ├── python-highs-knapsack ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.ipynb ├── main.py └── requirements.txt ├── python-nextmv-gurobipy-knapsack ├── LICENSE ├── README.md ├── app.yaml ├── gurobi.lic.template ├── input.json ├── main.ipynb ├── main.py └── requirements.txt ├── python-nextmv-scikit-learn-diabetes ├── LICENSE ├── README.md └── main.ipynb ├── python-nextroute ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.ipynb ├── main.py └── requirements.txt ├── python-ortools-costflow ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py └── requirements.txt ├── python-ortools-demandforecasting ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py ├── python-ortools.code-workspace └── requirements.txt ├── python-ortools-knapsack-multicsv ├── LICENSE ├── README.md ├── app.yaml ├── input │ ├── items.csv │ └── weight_capacity.csv ├── main.py └── requirements.txt ├── python-ortools-knapsack ├── LICENSE ├── README.md ├── app.yaml ├── inputs │ ├── input-1000items.json │ ├── input-100items.json │ ├── input-50items.json │ └── input.json ├── main.py └── requirements.txt ├── python-ortools-region-allocation ├── README.md ├── app.yaml ├── input.json ├── main.py └── requirements.txt ├── python-ortools-routing ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py └── requirements.txt ├── python-ortools-shiftassignment ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py └── requirements.txt ├── python-ortools-shiftplanning ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py └── requirements.txt ├── python-pyomo-knapsack ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py ├── python-pyomo.code-workspace └── requirements.txt ├── python-pyomo-shiftassignment ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py ├── python-pyomo.code-workspace └── requirements.txt ├── python-pyomo-shiftplanning ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py ├── python-pyomo.code-workspace └── requirements.txt ├── python-pyoptinterface-knapsack ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py ├── python-pyoptinterface.code-workspace └── requirements.txt ├── python-pyvroom-routing ├── .devcontainer │ └── devcontainer.json ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py ├── python-pyvroom.code-workspace └── requirements.txt ├── python-tr-ortools-region-allocation ├── README.md ├── input.json ├── main.py └── requirements.txt ├── python-wf-databricks-ml-gurobi-price-optimization ├── README.md ├── app.yaml ├── avocado-ml-regressor.ipynb ├── avocado-price-optimizer.ipynb ├── main.py └── requirements.txt ├── python-wf-databricks ├── README.md ├── app.yaml ├── hello-world-nextmv-app.ipynb ├── main.py └── requirements.txt ├── python-wf-ortools-region-allocation ├── README.md ├── app.yaml ├── input.json ├── main.py └── requirements.txt ├── python-xpress-knapsack ├── LICENSE ├── README.md ├── app.yaml ├── input.json ├── main.py └── requirements.txt └── ruff.toml /.github/workflows/json-lint.yml: -------------------------------------------------------------------------------- 1 | name: json lint 2 | on: [push] 3 | jobs: 4 | community-apps-json-lint: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: git clone 8 | uses: actions/checkout@v4 9 | 10 | - name: set up node 11 | uses: actions/setup-node@v4 12 | with: 13 | node-version: 18.8 14 | 15 | - name: install prettier 16 | run: npm install prettier@v2.7.1 --global 17 | 18 | - name: lint .json files with prettier 19 | run: prettier -c "**/*.json" 20 | -------------------------------------------------------------------------------- /.github/workflows/markdown-lint.yml: -------------------------------------------------------------------------------- 1 | name: markdown lint 2 | on: [push] 3 | jobs: 4 | community-apps-markdown-lint: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: git clone 8 | uses: actions/checkout@v4 9 | 10 | - uses: DavidAnson/markdownlint-cli2-action@v14 11 | with: 12 | globs: "**/*.md" 13 | -------------------------------------------------------------------------------- /.github/workflows/python-lint.yml: -------------------------------------------------------------------------------- 1 | name: python lint 2 | on: [push] 3 | jobs: 4 | community-apps-python-lint: 5 | runs-on: ubuntu-latest 6 | env: 7 | PYTHON_VERSION: "" 8 | steps: 9 | - name: git clone 10 | uses: actions/checkout@v4 11 | 12 | - name: set Python version 13 | run: | 14 | export PYTHON_VERSION=$(yq '.language-support.python.version' workflow-configuration.yml) 15 | echo "This is the Python version => $PYTHON_VERSION" 16 | echo "PYTHON_VERSION=${PYTHON_VERSION}" >> $GITHUB_ENV 17 | working-directory: .nextmv/ 18 | 19 | - name: set up Python 20 | uses: actions/setup-python@v5 21 | with: 22 | python-version: ${{ env.PYTHON_VERSION }} 23 | 24 | - name: install dependencies 25 | run: | 26 | python -m pip install --upgrade pip 27 | pip install ruff==0.6.4 28 | 29 | - name: lint with ruff 30 | run: ruff check --output-format=github . 31 | -------------------------------------------------------------------------------- /.github/workflows/static.yml: -------------------------------------------------------------------------------- 1 | # Simple workflow for deploying static content to GitHub Pages 2 | name: pages 3 | 4 | on: 5 | # Runs on pushes to the 'content' branch 6 | push: 7 | branches: ["content"] 8 | workflow_dispatch: 9 | 10 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 11 | permissions: 12 | contents: read 13 | pages: write 14 | id-token: write 15 | 16 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 17 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 18 | concurrency: 19 | group: "pages" 20 | cancel-in-progress: false 21 | 22 | jobs: 23 | deploy: 24 | environment: 25 | name: github-pages 26 | url: ${{ steps.deployment.outputs.page_url }} 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Checkout 30 | uses: actions/checkout@v4 31 | - name: Setup Pages 32 | uses: actions/configure-pages@v4 33 | - name: Upload artifact 34 | uses: actions/upload-pages-artifact@v3 35 | with: 36 | # Upload 'content' directory 37 | path: "content/" 38 | - name: Deploy to GitHub Pages 39 | id: deployment 40 | uses: actions/deploy-pages@v4 41 | -------------------------------------------------------------------------------- /.nextmv/golden/README.md: -------------------------------------------------------------------------------- 1 | # Golden file tests 2 | 3 | This directory contains golden file tests for the apps contained in this 4 | repository. These tests use the [`golden` package](https://github.com/nextmv-io/sdk/tree/develop/golden) 5 | of the Nextmv SDK to compare the output of the apps to a set of golden files. 6 | Each app has its own subdirectory containing the golden files for that app. 7 | 8 | ## Update expectations 9 | 10 | To update the golden files, simply run this command from this directory (or from 11 | the directory of the app you want to update): 12 | 13 | ```bash 14 | go test ./... --update 15 | ``` 16 | -------------------------------------------------------------------------------- /.nextmv/golden/go-hello-world/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "world" 3 | } 4 | -------------------------------------------------------------------------------- /.nextmv/golden/go-hello-world/inputs/input.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "statistics": { 3 | "result": { 4 | "custom": { 5 | "message": "Hello, world" 6 | }, 7 | "value": 1.23 8 | }, 9 | "schema": "v1" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.nextmv/golden/go-hello-world/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{}, 21 | TransientFields: []golden.TransientField{}, 22 | Thresholds: golden.Tresholds{ 23 | Float: 0.01, 24 | }, 25 | ExecutionConfig: &golden.ExecutionConfig{ 26 | Command: "go", 27 | Args: []string{"run", "."}, 28 | InputFlag: "-runner.input.path", 29 | OutputFlag: "-runner.output.path", 30 | WorkDir: "../../../go-hello-world", 31 | }, 32 | }, 33 | ) 34 | } 35 | -------------------------------------------------------------------------------- /.nextmv/golden/go-highs-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/go-highs-knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | "time" 7 | 8 | "github.com/nextmv-io/sdk/golden" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | code := m.Run() 13 | os.Exit(code) 14 | } 15 | 16 | func TestGolden(t *testing.T) { 17 | t.Skip("skipping until we have a path forward for go-mip and go-highs") 18 | golden.FileTests( 19 | t, 20 | "inputs", 21 | golden.Config{ 22 | Args: []string{ 23 | "-solve.duration", "3s", 24 | }, 25 | TransientFields: []golden.TransientField{ 26 | {Key: "$.version.sdk", Replacement: golden.StableVersion}, 27 | {Key: "$.version.go-mip", Replacement: golden.StableVersion}, 28 | {Key: "$.version.go-highs", Replacement: golden.StableVersion}, 29 | {Key: "$.statistics.result.duration", Replacement: golden.StableFloat}, 30 | {Key: "$.statistics.run.duration", Replacement: golden.StableFloat}, 31 | }, 32 | Thresholds: golden.Tresholds{ 33 | Float: 0.01, 34 | Time: time.Duration(5) * time.Second, 35 | Duration: time.Duration(5) * time.Second, 36 | }, 37 | ExecutionConfig: &golden.ExecutionConfig{ 38 | Command: "nextmv", 39 | Args: []string{"run", "."}, 40 | InputFlag: "-runner.input.path", 41 | OutputFlag: "-runner.output.path", 42 | WorkDir: "../../../go-highs-knapsack", 43 | }, 44 | }, 45 | ) 46 | } 47 | -------------------------------------------------------------------------------- /.nextmv/golden/go-highs-orderfulfillment/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | t.Skip("skipping until we have a path forward for go-mip and go-highs") 17 | golden.FileTests( 18 | t, 19 | "inputs", 20 | golden.Config{ 21 | Args: []string{ 22 | "-solve.duration", 23 | "3s", 24 | }, 25 | TransientFields: []golden.TransientField{ 26 | {Key: "$.version.sdk", Replacement: golden.StableVersion}, 27 | {Key: "$.version.go-mip", Replacement: golden.StableVersion}, 28 | {Key: "$.version.go-highs", Replacement: golden.StableVersion}, 29 | {Key: "$.statistics.result.duration", Replacement: golden.StableFloat}, 30 | {Key: "$.statistics.run.duration", Replacement: golden.StableFloat}, 31 | }, 32 | DedicatedComparison: []string{ 33 | "$.statistics.result.value", 34 | }, 35 | Thresholds: golden.Tresholds{ 36 | Float: 0.01, 37 | }, 38 | ExecutionConfig: &golden.ExecutionConfig{ 39 | Command: "go", 40 | Args: []string{"run", "."}, 41 | InputFlag: "-runner.input.path", 42 | OutputFlag: "-runner.output.path", 43 | WorkDir: "../../../go-highs-orderfulfillment", 44 | }, 45 | }, 46 | ) 47 | } 48 | -------------------------------------------------------------------------------- /.nextmv/golden/go-highs-shiftscheduling/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | t.Skip("skipping until we have a path forward for go-mip and go-highs") 17 | golden.FileTests( 18 | t, 19 | "inputs", 20 | golden.Config{ 21 | Args: []string{ 22 | "-solve.duration", "3s", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | {Key: "$.version.sdk", Replacement: golden.StableVersion}, 26 | {Key: "$.version.go-mip", Replacement: golden.StableVersion}, 27 | {Key: "$.version.go-highs", Replacement: golden.StableVersion}, 28 | {Key: "$.statistics.result.duration", Replacement: golden.StableFloat}, 29 | {Key: "$.statistics.run.duration", Replacement: golden.StableFloat}, 30 | }, 31 | DedicatedComparison: []string{ 32 | "$.statistics.result.value", 33 | }, 34 | Thresholds: golden.Tresholds{ 35 | Float: 0.01, 36 | }, 37 | ExecutionConfig: &golden.ExecutionConfig{ 38 | Command: "go", 39 | Args: []string{"run", "."}, 40 | InputFlag: "-runner.input.path", 41 | OutputFlag: "-runner.output.path", 42 | WorkDir: "../../../go-highs-shiftscheduling", 43 | }, 44 | }, 45 | ) 46 | } 47 | -------------------------------------------------------------------------------- /.nextmv/golden/go-nextroute/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-solve.duration", "3s", 22 | // for deterministic tests 23 | "-format.disable.progression", 24 | "-solve.parallelruns", "1", 25 | "-solve.iterations", "50", 26 | "-solve.rundeterministically", 27 | "-solve.startsolutions", "1", 28 | }, 29 | TransientFields: []golden.TransientField{ 30 | {Key: "$.version.sdk", Replacement: golden.StableVersion}, 31 | {Key: "$.version.nextroute", Replacement: golden.StableVersion}, 32 | {Key: "$.statistics.result.duration", Replacement: golden.StableFloat}, 33 | {Key: "$.statistics.run.duration", Replacement: golden.StableFloat}, 34 | }, 35 | Thresholds: golden.Tresholds{ 36 | Float: 0.01, 37 | }, 38 | ExecutionConfig: &golden.ExecutionConfig{ 39 | Command: "go", 40 | Args: []string{"run", "."}, 41 | InputFlag: "-runner.input.path", 42 | OutputFlag: "-runner.output.path", 43 | WorkDir: "../../../go-nextroute", 44 | }, 45 | }, 46 | ) 47 | } 48 | -------------------------------------------------------------------------------- /.nextmv/golden/go.mod: -------------------------------------------------------------------------------- 1 | module apps-golden-file-tests 2 | 3 | go 1.22 4 | 5 | require github.com/nextmv-io/sdk v1.8.0 6 | 7 | require ( 8 | github.com/sergi/go-diff v1.3.1 // indirect 9 | github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect 10 | github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect 11 | github.com/xeipuuv/gojsonschema v1.2.0 // indirect 12 | ) 13 | -------------------------------------------------------------------------------- /.nextmv/golden/java-ortools-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/java-ortools-knapsack/inputs/input.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "solutions": [ 3 | { 4 | "items": [ 5 | { 6 | "id": "cat", 7 | "value": 100, 8 | "weight": 20 9 | }, 10 | { 11 | "id": "water", 12 | "value": 40, 13 | "weight": 2 14 | }, 15 | { 16 | "id": "phone", 17 | "value": 6, 18 | "weight": 1 19 | }, 20 | { 21 | "id": "book", 22 | "value": 63, 23 | "weight": 10 24 | }, 25 | { 26 | "id": "rx", 27 | "value": 81, 28 | "weight": 1 29 | }, 30 | { 31 | "id": "coat", 32 | "value": 44, 33 | "weight": 9 34 | }, 35 | { 36 | "id": "keys", 37 | "value": 92, 38 | "weight": 1 39 | }, 40 | { 41 | "id": "nuts", 42 | "value": 18, 43 | "weight": 4 44 | } 45 | ], 46 | "value": 444 47 | } 48 | ], 49 | "statistics": { 50 | "result": { 51 | "custom": { 52 | "constraints": 1, 53 | "provider": "SCIP", 54 | "status": "OPTIMAL", 55 | "variables": 11 56 | }, 57 | "value": 444 58 | }, 59 | "run": { 60 | "duration": 0.123 61 | }, 62 | "schema": "v1" 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /.nextmv/golden/java-ortools-knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | "testing" 7 | 8 | "github.com/nextmv-io/sdk/golden" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | prepareApp() 13 | code := m.Run() 14 | golden.Reset([]string{"inputs", "main_test.go"}) 15 | os.Exit(code) 16 | } 17 | 18 | // prepareApp builds the app and moves the resulting jar to this directory. 19 | func prepareApp() { 20 | build := exec.Command("mvn", "package") 21 | build.Dir = "../../../java-ortools-knapsack" 22 | err := build.Run() 23 | if err != nil { 24 | panic(err) 25 | } 26 | 27 | err = os.Rename("../../../java-ortools-knapsack/main.jar", "main.jar") 28 | if err != nil { 29 | panic(err) 30 | } 31 | } 32 | 33 | func TestGolden(t *testing.T) { 34 | golden.FileTests( 35 | t, 36 | "inputs", 37 | golden.Config{ 38 | Args: []string{ 39 | "--duration", 40 | "30", 41 | }, 42 | TransientFields: []golden.TransientField{ 43 | { 44 | Key: "$.statistics.result.duration", 45 | Replacement: golden.StableFloat, 46 | }, 47 | { 48 | Key: "$.statistics.run.duration", 49 | Replacement: golden.StableFloat, 50 | }, 51 | }, 52 | ExecutionConfig: &golden.ExecutionConfig{ 53 | Command: "java", 54 | Args: []string{"-jar", "main.jar"}, 55 | InputFlag: "--input", 56 | OutputFlag: "--output", 57 | }, 58 | }, 59 | ) 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ampl-facilitylocation/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | "-modelpath", 24 | "../../../python-ampl-facilitylocation", 25 | "-runpath", 26 | "../../../python-ampl-facilitylocation", 27 | }, 28 | TransientFields: []golden.TransientField{ 29 | { 30 | Key: "$.statistics.result.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.statistics.run.duration", 35 | Replacement: golden.StableFloat, 36 | }, 37 | { 38 | Key: "$.options.output", 39 | Replacement: "output.json", 40 | }, 41 | { 42 | Key: "$.options.input", 43 | Replacement: "input.json", 44 | }, 45 | }, 46 | ExecutionConfig: &golden.ExecutionConfig{ 47 | Command: "python3", 48 | Args: []string{"../../../python-ampl-facilitylocation/main.py"}, 49 | InputFlag: "-input", 50 | OutputFlag: "-output", 51 | }, 52 | }, 53 | ) 54 | } 55 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ampl-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ampl-knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-ampl-knapsack/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ampl-priceoptimization/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "regions": [ 3 | "great_lakes", 4 | "midsouth", 5 | "northeast", 6 | "northern_new_england", 7 | "southcentral", 8 | "southeast", 9 | "west", 10 | "plains" 11 | ], 12 | "total_amount_of_supply": 30, 13 | "cost_per_wasted_product": 0.1, 14 | "peak": 1, 15 | "transport_costs": [0.3, 0.1, 0.4, 0.5, 0.3, 0.2, 0.2, 0.2], 16 | "year": 2024, 17 | "minimum_product_price": 0, 18 | "maximum_product_price": 2, 19 | "minimum_product_allocations": [ 20 | 2.063574, 1.845443, 2.364424, 0.21969, 3.68713, 2.197764, 3.260102, 1.058938 21 | ], 22 | "maximum_product_allocations": [ 23 | 7.094765, 6.168572, 8.836406, 0.917984, 10.323175, 7.810475, 11.274749, 24 | 3.575499 25 | ], 26 | "coefficients": { 27 | "region": [ 28 | 0, -0.242693153677881, 1.433019836643242, -3.019243790637881, 29 | 1.7138120739734646, 0.5839901666611692, 2.6017994486412657, 30 | -1.8150328723904097 31 | ], 32 | "price": -2.2037701048902467, 33 | "intercept": 5.43931005216503, 34 | "year_index": 0.16076930231844555, 35 | "peak": 0.548510505830839 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ampl-priceoptimization/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | "-model", 24 | "../../../python-ampl-priceoptimization", 25 | }, 26 | TransientFields: []golden.TransientField{ 27 | { 28 | Key: "$.statistics.result.duration", 29 | Replacement: golden.StableFloat, 30 | }, 31 | { 32 | Key: "$.statistics.run.duration", 33 | Replacement: golden.StableFloat, 34 | }, 35 | { 36 | Key: "$.options.output", 37 | Replacement: "output.json", 38 | }, 39 | { 40 | Key: "$.options.input", 41 | Replacement: "input.json", 42 | }, 43 | }, 44 | ExecutionConfig: &golden.ExecutionConfig{ 45 | Command: "python3", 46 | Args: []string{"../../../python-ampl-priceoptimization/main.py"}, 47 | InputFlag: "-input", 48 | OutputFlag: "-output", 49 | }, 50 | DedicatedComparison: []string{ 51 | "$.statistics.result.value", 52 | }, 53 | Thresholds: golden.Tresholds{ 54 | Float: 2.00, 55 | }, 56 | }, 57 | ) 58 | } 59 | -------------------------------------------------------------------------------- /.nextmv/golden/python-gurobi-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/python-gurobi-knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-gurobi-knapsack/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-hello-world/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "world", 3 | "radius": 6378, 4 | "distance": 147.6 5 | } 6 | -------------------------------------------------------------------------------- /.nextmv/golden/python-hello-world/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | UseStdIn: true, 21 | UseStdOut: true, 22 | ExecutionConfig: &golden.ExecutionConfig{ 23 | Command: "python3", 24 | Args: []string{"../../../python-hello-world/main.py"}, 25 | }, 26 | DedicatedComparison: []string{ 27 | "$.statistics.result.value", 28 | }, 29 | }, 30 | ) 31 | } 32 | -------------------------------------------------------------------------------- /.nextmv/golden/python-highs-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/python-highs-knapsack/inputs/input.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "assets": [], 3 | "options": { 4 | "duration": 30, 5 | "input": "input.json", 6 | "output": "output.json", 7 | "version": "1.9.0" 8 | }, 9 | "solution": { 10 | "items": [ 11 | { 12 | "id": "cat", 13 | "value": 100, 14 | "weight": 20 15 | }, 16 | { 17 | "id": "water", 18 | "value": 40, 19 | "weight": 2 20 | }, 21 | { 22 | "id": "phone", 23 | "value": 6, 24 | "weight": 1 25 | }, 26 | { 27 | "id": "book", 28 | "value": 63, 29 | "weight": 10 30 | }, 31 | { 32 | "id": "rx", 33 | "value": 81, 34 | "weight": 1 35 | }, 36 | { 37 | "id": "coat", 38 | "value": 44, 39 | "weight": 9 40 | }, 41 | { 42 | "id": "keys", 43 | "value": 92, 44 | "weight": 1 45 | }, 46 | { 47 | "id": "nuts", 48 | "value": 18, 49 | "weight": 4 50 | } 51 | ] 52 | }, 53 | "statistics": { 54 | "result": { 55 | "custom": { 56 | "constraints": 1, 57 | "status": "HighsStatus.kOk", 58 | "variables": 11 59 | }, 60 | "value": 444 61 | }, 62 | "run": { 63 | "duration": 0.123 64 | }, 65 | "schema": "v1" 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /.nextmv/golden/python-highs-knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-highs-knapsack/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-nextmv-gurobipy-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/python-nextmv-gurobipy-knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-TimeLimit", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-nextmv-gurobipy-knapsack/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-nextroute/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-solve_duration", "3", 22 | // for deterministic tests 23 | "-format_disable_progression", "true", 24 | "-solve_parallelruns", "1", 25 | "-solve_iterations", "50", 26 | "-solve_rundeterministically", "true", 27 | "-solve_startsolutions", "1", 28 | }, 29 | TransientFields: []golden.TransientField{ 30 | {Key: "$.statistics.result.duration", Replacement: golden.StableFloat}, 31 | {Key: "$.statistics.run.duration", Replacement: golden.StableFloat}, 32 | {Key: "$.options.output", Replacement: "output.json"}, 33 | {Key: "$.options.input", Replacement: "input.json"}, 34 | }, 35 | Thresholds: golden.Tresholds{ 36 | Float: 0.01, 37 | }, 38 | ExecutionConfig: &golden.ExecutionConfig{ 39 | Command: "python3", 40 | Args: []string{"../../../python-nextroute/main.py"}, 41 | InputFlag: "-input", 42 | OutputFlag: "-output", 43 | }, 44 | }, 45 | ) 46 | } 47 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-costflow/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ 3 | { 4 | "id": "project-1", 5 | "required_skills": ["programming"], 6 | "value": 3000, 7 | "required_time": 2 8 | }, 9 | { 10 | "id": "project-2", 11 | "required_skills": ["programming", "design"], 12 | "value": 4500, 13 | "required_time": 4 14 | }, 15 | { 16 | "id": "project-3", 17 | "required_skills": ["design"], 18 | "value": 3500, 19 | "required_time": 3 20 | }, 21 | { 22 | "id": "project-4", 23 | "required_skills": ["design"], 24 | "value": 2450, 25 | "required_time": 2 26 | }, 27 | { 28 | "id": "project-5", 29 | "required_skills": ["programming"], 30 | "value": 4000, 31 | "required_time": 5 32 | } 33 | ], 34 | "workers": [ 35 | { 36 | "id": "worker-1", 37 | "skills": ["programming"], 38 | "available_time": 3 39 | }, 40 | { 41 | "id": "worker-2", 42 | "skills": ["programming", "design"], 43 | "available_time": 9 44 | }, 45 | { 46 | "id": "worker-3", 47 | "skills": ["design"], 48 | "available_time": 4 49 | } 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-costflow/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{}, 21 | TransientFields: []golden.TransientField{ 22 | { 23 | Key: "$.statistics.result.duration", 24 | Replacement: float64(0.015), 25 | }, 26 | { 27 | Key: "$.statistics.run.duration", 28 | Replacement: float64(0.015), 29 | }, 30 | { 31 | Key: "$.options.output", 32 | Replacement: "output.json", 33 | }, 34 | { 35 | Key: "$.options.input", 36 | Replacement: "input.json", 37 | }, 38 | }, 39 | DedicatedComparison: []string{ 40 | "$.statistics.result.value", 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-ortools-costflow/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-knapsack/inputs/input.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "assets": [], 3 | "options": { 4 | "duration": 30, 5 | "input": "input.json", 6 | "output": "output.json", 7 | "provider": "SCIP" 8 | }, 9 | "solution": { 10 | "items": [ 11 | { 12 | "id": "cat", 13 | "value": 100, 14 | "weight": 20 15 | }, 16 | { 17 | "id": "water", 18 | "value": 40, 19 | "weight": 2 20 | }, 21 | { 22 | "id": "phone", 23 | "value": 6, 24 | "weight": 1 25 | }, 26 | { 27 | "id": "book", 28 | "value": 63, 29 | "weight": 10 30 | }, 31 | { 32 | "id": "rx", 33 | "value": 81, 34 | "weight": 1 35 | }, 36 | { 37 | "id": "coat", 38 | "value": 44, 39 | "weight": 9 40 | }, 41 | { 42 | "id": "keys", 43 | "value": 92, 44 | "weight": 1 45 | }, 46 | { 47 | "id": "nuts", 48 | "value": 18, 49 | "weight": 4 50 | } 51 | ] 52 | }, 53 | "statistics": { 54 | "result": { 55 | "custom": { 56 | "constraints": 1, 57 | "status": "optimal", 58 | "variables": 11 59 | }, 60 | "duration": 0.123, 61 | "value": 444 62 | }, 63 | "run": { 64 | "duration": 0.123 65 | }, 66 | "schema": "v1" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-ortools-knapsack/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-region-allocation/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-ortools-region-allocation/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-routing/inputs/both-matrices.md: -------------------------------------------------------------------------------- 1 | # both-matrices 2 | 3 | A test input with both matrices (duration and distance) provided. The app will 4 | use the duration matrix for assessing routing costs. 5 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-routing/inputs/distance-matrix.md: -------------------------------------------------------------------------------- 1 | # distance-matrix 2 | 3 | A test input with the distance matrix and speed given. The app will use them to 4 | determine the travel cost between locations. 5 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-routing/inputs/max-duration.md: -------------------------------------------------------------------------------- 1 | # max-duration 2 | 3 | A test input with a max duration limit that will be applied to the duration 4 | resulting from the provided duration matrix. The app will use the duration 5 | matrix for assessing routing costs. 6 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-routing/inputs/no-matrix.md: -------------------------------------------------------------------------------- 1 | # no-matrix 2 | 3 | A test input with no matrix provided. The app will fall back to using the 4 | Haversine formula to calculate the cost of travel between locations. 5 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-routing/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-ortools-routing/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-shiftassignment/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-ortools-shiftassignment/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-ortools-shiftplanning/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-ortools-shiftplanning/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyomo-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyomo-knapsack/inputs/input.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "assets": [], 3 | "options": { 4 | "duration": 30, 5 | "input": "input.json", 6 | "output": "output.json", 7 | "provider": "cbc" 8 | }, 9 | "solution": { 10 | "items": [ 11 | { 12 | "id": "cat", 13 | "value": 100, 14 | "weight": 20 15 | }, 16 | { 17 | "id": "water", 18 | "value": 40, 19 | "weight": 2 20 | }, 21 | { 22 | "id": "phone", 23 | "value": 6, 24 | "weight": 1 25 | }, 26 | { 27 | "id": "book", 28 | "value": 63, 29 | "weight": 10 30 | }, 31 | { 32 | "id": "rx", 33 | "value": 81, 34 | "weight": 1 35 | }, 36 | { 37 | "id": "coat", 38 | "value": 44, 39 | "weight": 9 40 | }, 41 | { 42 | "id": "keys", 43 | "value": 92, 44 | "weight": 1 45 | }, 46 | { 47 | "id": "nuts", 48 | "value": 18, 49 | "weight": 4 50 | } 51 | ] 52 | }, 53 | "statistics": { 54 | "result": { 55 | "custom": { 56 | "constraints": 1, 57 | "status": "optimal", 58 | "variables": 11 59 | }, 60 | "duration": 0.123, 61 | "value": 444 62 | }, 63 | "run": { 64 | "duration": 0.123 65 | }, 66 | "schema": "v1" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyomo-knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-pyomo-knapsack/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyomo-knapsack/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script installs additional dependencies required for the test 4 | 5 | sudo apt-get update 6 | sudo apt-get install -y coinor-cbc coinor-libcbc-dev 7 | sudo apt-get install -y glpk-utils 8 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyomo-shiftassignment/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-pyomo-shiftassignment/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyomo-shiftassignment/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script installs additional dependencies required for the test 4 | 5 | sudo apt-get update 6 | sudo apt-get install -y coinor-cbc coinor-libcbc-dev 7 | sudo apt-get install -y glpk-utils 8 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyomo-shiftplanning/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-pyomo-shiftplanning/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyomo-shiftplanning/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script installs additional dependencies required for the test 4 | 5 | sudo apt-get update 6 | sudo apt-get install -y coinor-cbc coinor-libcbc-dev 7 | sudo apt-get install -y glpk-utils 8 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyoptinterface-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyoptinterface-knapsack/inputs/input.json.golden: -------------------------------------------------------------------------------- 1 | { 2 | "assets": [], 3 | "options": { 4 | "duration": 30, 5 | "input": "input.json", 6 | "output": "output.json", 7 | "version": "0.4.0" 8 | }, 9 | "solution": { 10 | "items": [ 11 | { 12 | "id": "cat", 13 | "value": 100, 14 | "weight": 20 15 | }, 16 | { 17 | "id": "water", 18 | "value": 40, 19 | "weight": 2 20 | }, 21 | { 22 | "id": "phone", 23 | "value": 6, 24 | "weight": 1 25 | }, 26 | { 27 | "id": "book", 28 | "value": 63, 29 | "weight": 10 30 | }, 31 | { 32 | "id": "rx", 33 | "value": 81, 34 | "weight": 1 35 | }, 36 | { 37 | "id": "coat", 38 | "value": 44, 39 | "weight": 9 40 | }, 41 | { 42 | "id": "keys", 43 | "value": 92, 44 | "weight": 1 45 | }, 46 | { 47 | "id": "nuts", 48 | "value": 18, 49 | "weight": 4 50 | } 51 | ] 52 | }, 53 | "statistics": { 54 | "result": { 55 | "custom": { 56 | "constraints": 1, 57 | "status": "TerminationStatusCode.OPTIMAL", 58 | "variables": 11 59 | }, 60 | "value": 444 61 | }, 62 | "run": { 63 | "duration": 0.123 64 | }, 65 | "schema": "v1" 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyoptinterface-knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-pyoptinterface-knapsack/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyvroom-routing/inputs/both-matrices.md: -------------------------------------------------------------------------------- 1 | # both-matrices 2 | 3 | A test input with both matrices (duration and distance) provided. The app will 4 | use the duration matrix for assessing routing costs. 5 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyvroom-routing/inputs/distance-matrix.md: -------------------------------------------------------------------------------- 1 | # distance-matrix 2 | 3 | A test input with the distance matrix and speed given. The app will use them to 4 | determine the travel cost between locations. 5 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyvroom-routing/inputs/max-duration.md: -------------------------------------------------------------------------------- 1 | # max-duration 2 | 3 | A test input with a max duration limit that will be applied to the duration 4 | resulting from the provided duration matrix. The app will use the duration 5 | matrix for assessing routing costs. 6 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyvroom-routing/inputs/no-matrix.md: -------------------------------------------------------------------------------- 1 | # no-matrix 2 | 3 | A test input with no matrix provided. The app will fall back to using the 4 | Haversine formula to calculate the cost of travel between locations. 5 | -------------------------------------------------------------------------------- /.nextmv/golden/python-pyvroom-routing/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | ExecutionConfig: &golden.ExecutionConfig{ 43 | Command: "python3", 44 | Args: []string{"../../../python-pyvroom-routing/main.py"}, 45 | InputFlag: "-input", 46 | OutputFlag: "-output", 47 | }, 48 | }, 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /.nextmv/golden/python-xpress-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /.nextmv/golden/python-xpress-knapsack/main_test.go: -------------------------------------------------------------------------------- 1 | package mip 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/nextmv-io/sdk/golden" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | code := m.Run() 12 | os.Exit(code) 13 | } 14 | 15 | func TestGolden(t *testing.T) { 16 | golden.FileTests( 17 | t, 18 | "inputs", 19 | golden.Config{ 20 | Args: []string{ 21 | "-duration", 22 | "30", 23 | }, 24 | TransientFields: []golden.TransientField{ 25 | { 26 | Key: "$.statistics.result.duration", 27 | Replacement: golden.StableFloat, 28 | }, 29 | { 30 | Key: "$.statistics.run.duration", 31 | Replacement: golden.StableFloat, 32 | }, 33 | { 34 | Key: "$.options.output", 35 | Replacement: "output.json", 36 | }, 37 | { 38 | Key: "$.options.input", 39 | Replacement: "input.json", 40 | }, 41 | }, 42 | // We ignore stdout here, as it may contain community license 43 | // warnings depending on whether a license was set up or not (not 44 | // the intention of the test). 45 | IgnoreStdOut: true, 46 | ExecutionConfig: &golden.ExecutionConfig{ 47 | Command: "python3", 48 | Args: []string{"../../../python-xpress-knapsack/main.py"}, 49 | InputFlag: "-input", 50 | OutputFlag: "-output", 51 | }, 52 | }, 53 | ) 54 | } 55 | -------------------------------------------------------------------------------- /.nextmv/readme/go-hello-world/0.sh: -------------------------------------------------------------------------------- 1 | cat input.json | go run . 2 | -------------------------------------------------------------------------------- /.nextmv/readme/go-hello-world/0.sh.golden: -------------------------------------------------------------------------------- 1 | {"options":{},"solution":{},"statistics":{"schema":"v1","result":{"value":1.23,"custom":{"message":"Hello, world"}}}} 2 | -------------------------------------------------------------------------------- /.nextmv/readme/go-highs-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | go run . -runner.input.path input.json \ 2 | -runner.output.path output.json -solve.duration 10s 3 | -------------------------------------------------------------------------------- /.nextmv/readme/go-highs-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/go-highs-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/go-highs-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | GOOS=linux go build -o main . && \ 2 | cat input.json | docker run -i --rm \ 3 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/default:latest \ 4 | /app/main 5 | -------------------------------------------------------------------------------- /.nextmv/readme/go-highs-orderfulfillment/0.sh: -------------------------------------------------------------------------------- 1 | go run . -runner.input.path input.json \ 2 | -runner.output.path output.json -solve.duration 10s 3 | -------------------------------------------------------------------------------- /.nextmv/readme/go-highs-orderfulfillment/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/go-highs-orderfulfillment/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/go-highs-orderfulfillment/1.sh: -------------------------------------------------------------------------------- 1 | GOOS=linux go build -o main . && \ 2 | cat input.json | docker run -i --rm \ 3 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/default:latest \ 4 | /app/main 5 | -------------------------------------------------------------------------------- /.nextmv/readme/go-highs-shiftscheduling/0.sh: -------------------------------------------------------------------------------- 1 | go run . -runner.input.path input.json \ 2 | -runner.output.path output.json -solve.duration 10s 3 | -------------------------------------------------------------------------------- /.nextmv/readme/go-highs-shiftscheduling/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/go-highs-shiftscheduling/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/go-highs-shiftscheduling/1.sh: -------------------------------------------------------------------------------- 1 | GOOS=linux go build -o main . && \ 2 | cat input.json | docker run -i --rm \ 3 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/default:latest \ 4 | /app/main 5 | -------------------------------------------------------------------------------- /.nextmv/readme/go-nextroute/0.sh: -------------------------------------------------------------------------------- 1 | go run . -runner.input.path input.json \ 2 | -runner.output.path output.json -solve.duration 10s 3 | -------------------------------------------------------------------------------- /.nextmv/readme/go-nextroute/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/go-nextroute/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/go-nextroute/1.sh: -------------------------------------------------------------------------------- 1 | GOOS=linux go build -o main . && \ 2 | cat input.json | docker run -i --rm \ 3 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/default:latest \ 4 | /app/main 5 | -------------------------------------------------------------------------------- /.nextmv/readme/go.mod: -------------------------------------------------------------------------------- 1 | module apps-readme-tests 2 | 3 | go 1.22 4 | 5 | require ( 6 | github.com/nextmv-io/sdk v1.8.0 7 | gopkg.in/yaml.v2 v2.4.0 8 | ) 9 | 10 | require ( 11 | github.com/sergi/go-diff v1.3.1 // indirect 12 | github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect 13 | github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect 14 | github.com/xeipuuv/gojsonschema v1.2.0 // indirect 15 | ) 16 | -------------------------------------------------------------------------------- /.nextmv/readme/java-gurobi-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | mvn package 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-gurobi-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/java-gurobi-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/java-gurobi-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | java -jar main.jar --input input.json 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-gurobi-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | nextmv push --app-id 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-gurobi-knapsack/3.sh: -------------------------------------------------------------------------------- 1 | mvn package && cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/java:latest \ 3 | java -jar /app/main.jar 4 | -------------------------------------------------------------------------------- /.nextmv/readme/java-hello-world/0.sh: -------------------------------------------------------------------------------- 1 | mvn package 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-hello-world/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/java-hello-world/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/java-hello-world/1.sh: -------------------------------------------------------------------------------- 1 | cat input.json | java -jar main.jar 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-hello-world/1.sh.golden: -------------------------------------------------------------------------------- 1 | {"options":{},"solution":{},"statistics":{"schema":"v1","result":{"value":1.23,"custom":{"message":"Hello, world"}}}} 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-hexaly-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | mvn install:install-file \ 2 | -Dfile=lib/hexaly.jar \ 3 | -DgroupId=com.hexaly \ 4 | -DartifactId=hexaly \ 5 | -Dversion=1.0.0 \ 6 | -Dpackaging=jar \ 7 | -DgeneratePom=true 8 | -------------------------------------------------------------------------------- /.nextmv/readme/java-hexaly-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | mvn package # to generate main.jar 2 | java -jar main.jar --input input.json 3 | -------------------------------------------------------------------------------- /.nextmv/readme/java-hexaly-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | nextmv push --app-id 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-hexaly-knapsack/3.sh: -------------------------------------------------------------------------------- 1 | mvn package && cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/java:latest \ 3 | java -jar /app/main.jar 4 | -------------------------------------------------------------------------------- /.nextmv/readme/java-ortools-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | mvn package 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-ortools-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/java-ortools-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/java-ortools-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | java -jar main.jar --input input.json 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-ortools-knapsack/1.sh.golden: -------------------------------------------------------------------------------- 1 | {"solutions":[{"items":[{"id":"cat","weight":20.0,"value":100.0},{"id":"water","weight":2.0,"value":40.0},{"id":"phone","weight":1.0,"value":6.0},{"id":"book","weight":10.0,"value":63.0},{"id":"rx","weight":1.0,"value":81.0},{"id":"coat","weight":9.0,"value":44.0},{"id":"keys","weight":1.0,"value":92.0},{"id":"nuts","weight":4.0,"value":18.0}],"value":444.0}],"statistics":{"schema":"v1","run":{"duration":0.123},"result":{"value":444.0,"custom":{"provider":"SCIP","status":"OPTIMAL","variables":11,"constraints":1}}}} 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-ortools-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | mvn package && cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/java:latest \ 3 | java -jar /app/main.jar 4 | -------------------------------------------------------------------------------- /.nextmv/readme/java-ortools-routing/0.sh: -------------------------------------------------------------------------------- 1 | mvn package 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-ortools-routing/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/java-ortools-routing/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/java-ortools-routing/1.sh: -------------------------------------------------------------------------------- 1 | java -jar main.jar --input input.json 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-ortools-routing/1.sh.golden: -------------------------------------------------------------------------------- 1 | {"solutions":[{"vehicles":[{"vehicle":0,"distance":0.0,"stops":[0,0]},{"vehicle":1,"distance":0.0,"stops":[0,0]},{"vehicle":2,"distance":0.0,"stops":[0,0]},{"vehicle":3,"distance":4384.0,"stops":[0,9,5,8,6,2,10,16,14,13,12,11,15,3,4,1,7,0]}],"value":4384.0}],"statistics":{"schema":"v1","run":{"duration":0.123},"result":{"value":4384.0,"duration":0.123,"custom":{"activated_vehicles":1,"max_route_distance":4384,"min_stops_in_vehicle":0,"max_stops_in_vehicle":16}}}} 2 | -------------------------------------------------------------------------------- /.nextmv/readme/java-ortools-routing/2.sh: -------------------------------------------------------------------------------- 1 | mvn package && cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/java:latest \ 3 | java -jar /app/main.jar 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-facilitylocation/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-facilitylocation/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ampl-facilitylocation/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-facilitylocation/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -provider highs -modelpath . -runpath . 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-facilitylocation/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ampl-facilitylocation/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-facilitylocation/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ampl-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -provider highs 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-knapsack/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ampl-knapsack/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-priceoptimization/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-priceoptimization/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ampl-priceoptimization/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-priceoptimization/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -provider highs -model . 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-priceoptimization/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ampl-priceoptimization/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ampl-priceoptimization/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-gurobi-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-gurobi-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-gurobi-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-gurobi-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json -duration 30 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-gurobi-knapsack/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-gurobi-knapsack/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-gurobi-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-hello-world/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-hello-world/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-hello-world/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-hello-world/1.sh: -------------------------------------------------------------------------------- 1 | cat input.json | python3 main.py 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-hello-world/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-hello-world/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-hello-world/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt &> /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-hexaly-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-hexaly-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-hexaly-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-hexaly-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json -duration 30 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-hexaly-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/hexaly:latest \ 3 | sh -c 'python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-highs-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-highs-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-highs-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-highs-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json -duration 30 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-highs-knapsack/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-highs-knapsack/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-highs-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-nextmv-gurobipy-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-nextmv-gurobipy-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-nextmv-gurobipy-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-nextmv-gurobipy-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json -TimeLimit 30 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-nextmv-gurobipy-knapsack/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-nextmv-gurobipy-knapsack/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-nextmv-gurobipy-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-nextroute/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-nextroute/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-nextroute/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-nextroute/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -solve_duration 10 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-nextroute/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-nextroute/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-costflow/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-costflow/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-costflow/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-costflow/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -penalty 3000 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-costflow/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-costflow/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-costflow/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-demandforecasting/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-demandforecasting/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-demandforecasting/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-demandforecasting/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -provider SCIP -include_past true 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-demandforecasting/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-demandforecasting/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-demandforecasting/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-knapsack-multicsv/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-knapsack-multicsv/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-knapsack-multicsv/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-knapsack-multicsv/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input -output output -duration 30 -provider SCIP 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-knapsack-multicsv/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-knapsack-multicsv/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-knapsack-multicsv/2.sh: -------------------------------------------------------------------------------- 1 | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input inputs/input.json -output output.json \ 2 | -duration 30 -provider SCIP 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-knapsack/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-knapsack/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | cat inputs/input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-region-allocation/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-region-allocation/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-region-allocation/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-region-allocation/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -provider scip 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-region-allocation/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-region-allocation/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-region-allocation/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/pyomo:latest \ 3 | sh -c 'python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-routing/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-routing/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-routing/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-routing/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json -duration 30 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-routing/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-routing/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-routing/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-shiftassignment/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-shiftassignment/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-shiftassignment/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-shiftassignment/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -provider SCIP 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-shiftassignment/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-shiftassignment/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-shiftassignment/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-shiftplanning/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-shiftplanning/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-shiftplanning/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-shiftplanning/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -provider SCIP 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-shiftplanning/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-ortools-shiftplanning/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-ortools-shiftplanning/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-pyomo-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -provider cbc 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-knapsack/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-pyomo-knapsack/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/pyomo:latest \ 3 | sh -c 'python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-shiftassignment/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-shiftassignment/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-pyomo-shiftassignment/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-shiftassignment/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -provider cbc 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-shiftassignment/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-pyomo-shiftassignment/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-shiftassignment/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/pyomo:latest \ 3 | sh -c 'python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-shiftplanning/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-shiftplanning/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-pyomo-shiftplanning/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-shiftplanning/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -provider cbc 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-shiftplanning/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-pyomo-shiftplanning/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-pyomo-shiftplanning/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/pyomo:latest \ 3 | sh -c 'python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyoptinterface-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyoptinterface-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-pyoptinterface-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-pyoptinterface-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json -duration 30 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyoptinterface-knapsack/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-pyoptinterface-knapsack/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-pyoptinterface-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyvroom-routing/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyvroom-routing/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-pyvroom-routing/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-pyvroom-routing/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json \ 2 | -duration 30 -exploration_level 4 -threads 6 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-pyvroom-routing/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-pyvroom-routing/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-pyvroom-routing/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:latest \ 3 | sh -c 'python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/readme/python-tr-ortools-region-allocation/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-tr-ortools-region-allocation/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-tr-ortools-region-allocation/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-tr-ortools-region-allocation/1.sh: -------------------------------------------------------------------------------- 1 | export NEXTMV_API_KEY=your_api_key 2 | export NEXTMV_APP_ID=your_app_id 3 | -------------------------------------------------------------------------------- /.nextmv/readme/python-tr-ortools-region-allocation/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-tr-ortools-region-allocation/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-tr-ortools-region-allocation/2.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-databricks-ml-gurobi-price-optimization/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-databricks-ml-gurobi-price-optimization/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-wf-databricks-ml-gurobi-price-optimization/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-databricks-ml-gurobi-price-optimization/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py --db_job_id= --supply= 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-databricks-ml-gurobi-price-optimization/2.sh: -------------------------------------------------------------------------------- 1 | databricks secrets put-secret --json '{ 2 | "scope": "", 3 | "key": "nextmv-api-key", 4 | "string_value": "" 5 | }' 6 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-databricks/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-databricks/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-wf-databricks/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-databricks/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py --db_job_id= 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-databricks/2.sh: -------------------------------------------------------------------------------- 1 | databricks secrets put-secret --json '{ 2 | "scope": "", 3 | "key": "nextmv-api-key", 4 | "string_value": "" 5 | }' 6 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-ortools-region-allocation/0.sh: -------------------------------------------------------------------------------- 1 | cd ../python-ortools-region-allocation 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-ortools-region-allocation/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-wf-ortools-region-allocation/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-ortools-region-allocation/1.sh: -------------------------------------------------------------------------------- 1 | nextmv app push -a region-allocation 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-ortools-region-allocation/2.sh: -------------------------------------------------------------------------------- 1 | cd ../python-wf-ortools-region-allocation 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-ortools-region-allocation/2.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-wf-ortools-region-allocation/2.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-ortools-region-allocation/3.sh: -------------------------------------------------------------------------------- 1 | nextmv app push -a region-allocation-workflow 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-ortools-region-allocation/4.sh: -------------------------------------------------------------------------------- 1 | nextmv app version create -a region-allocation-workflow -v v1.0.0 -n v1.0.0 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-ortools-region-allocation/5.sh: -------------------------------------------------------------------------------- 1 | nextmv app instance create \ 2 | -a region-allocation-workflow \ 3 | -v v1.0.0 \ 4 | -i main \ 5 | -n "Main Instance" 6 | -------------------------------------------------------------------------------- /.nextmv/readme/python-wf-ortools-region-allocation/6.sh: -------------------------------------------------------------------------------- 1 | nextmv app run -a region-allocation-workflow --instance-id main --input input.json 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-xpress-knapsack/0.sh: -------------------------------------------------------------------------------- 1 | pip3 install -r requirements.txt 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-xpress-knapsack/0.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-xpress-knapsack/0.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-xpress-knapsack/1.sh: -------------------------------------------------------------------------------- 1 | python3 main.py -input input.json -output output.json -duration 30 2 | -------------------------------------------------------------------------------- /.nextmv/readme/python-xpress-knapsack/1.sh.golden: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmv-io/community-apps/5483efcae71eb987f4ee39d14882d6f8f04160fd/.nextmv/readme/python-xpress-knapsack/1.sh.golden -------------------------------------------------------------------------------- /.nextmv/readme/python-xpress-knapsack/2.sh: -------------------------------------------------------------------------------- 1 | cat input.json | docker run -i --rm \ 2 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/python:3.11 \ 3 | sh -c 'pip install -r requirements.txt > /dev/null && python3 /app/main.py' 4 | -------------------------------------------------------------------------------- /.nextmv/release/README.md: -------------------------------------------------------------------------------- 1 | # Release 2 | 3 | Release one or more apps. Releasing an app means the following. 4 | 5 | - The latest version will be available to be cloned via `nextmv community clone`. 6 | - If the app has a marketplace counterpart, the latest version will be pushed. 7 | 8 | `cd` into the `release` dir. 9 | 10 | - Install the packages. 11 | 12 | ```bash 13 | pip install -r requirements.txt 14 | ``` 15 | 16 | - Execute the release for the desired apps. 17 | 18 | ```bash 19 | python main.py \ 20 | -apps app1,app2 \ 21 | -bucket BUCKET \ 22 | -folder FOLDER \ 23 | -manifest MANIFEST_FILE 24 | ``` 25 | -------------------------------------------------------------------------------- /.nextmv/release/log.py: -------------------------------------------------------------------------------- 1 | import nextmv 2 | 3 | 4 | def log(message: str): 5 | """Logs a message to the console.""" 6 | 7 | nextmv.log(f"🐰 {message}") 8 | -------------------------------------------------------------------------------- /.nextmv/release/requirements.txt: -------------------------------------------------------------------------------- 1 | boto3>=1.34.33 2 | pyyaml>=6.0.1 3 | ruff>=0.1.7 4 | requests>=2.26.0 5 | nextmv==0.26.3 6 | -------------------------------------------------------------------------------- /.prettierrc.yml: -------------------------------------------------------------------------------- 1 | tabWidth: 2 2 | -------------------------------------------------------------------------------- /go-hello-world/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Go Hello World 2 | 3 | Simple example for running a Go application on the Nextmv Platform. 4 | 5 | 1. Run the app. 6 | 7 | ```bash 8 | cat input.json | go run . 9 | ``` 10 | 11 | ## Next steps 12 | 13 | * Open `main.go` and start writing the model. 14 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 15 | [Contact][contact] us! 16 | 17 | [docs]: https://docs.nextmv.io 18 | [blog]: https://www.nextmv.io/blog 19 | [contact]: https://www.nextmv.io/contact 20 | -------------------------------------------------------------------------------- /go-hello-world/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: go 3 | runtime: ghcr.io/nextmv-io/runtime/default:latest 4 | 5 | # Directives to build a Go binary from the app. 6 | build: 7 | command: go build -o main . 8 | environment: 9 | GOOS: linux 10 | GOARCH: arm64 11 | 12 | # List all files/directories that should be included in the app. Globbing 13 | # (e.g.: configs/*.json) is supported. 14 | files: 15 | - main 16 | -------------------------------------------------------------------------------- /go-hello-world/go.mod: -------------------------------------------------------------------------------- 1 | module example.com/your_project/go-hello-world 2 | 3 | go 1.22 4 | 5 | require github.com/nextmv-io/sdk v1.8.0 6 | 7 | require ( 8 | github.com/danielgtaylor/huma v1.14.2 // indirect 9 | github.com/google/uuid v1.6.0 // indirect 10 | github.com/gorilla/schema v1.4.1 // indirect 11 | github.com/iancoleman/strcase v0.3.0 // indirect 12 | github.com/itzg/go-flagsfiller v1.14.0 // indirect 13 | github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect 14 | github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect 15 | github.com/xeipuuv/gojsonschema v1.2.0 // indirect 16 | ) 17 | -------------------------------------------------------------------------------- /go-hello-world/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "world" 3 | } 4 | -------------------------------------------------------------------------------- /go-highs-knapsack/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Go HiGHS Knapsack 2 | 3 | Example for running a Go application on the Nextmv Platform using the HiGHS 4 | solver. We solve a knapsack Mixed Integer Programming problem. 5 | 6 | 1. Run the app. 7 | 8 | ```bash 9 | go run . -runner.input.path input.json \ 10 | -runner.output.path output.json -solve.duration 10s 11 | ``` 12 | 13 | To push your app to the Nextmv platform via `nextmv app push ...`, you will 14 | need to have [zig][zig] installed and available on your `$PATH`. 15 | 16 | ## Next steps 17 | 18 | * Open `main.go` and modify the model. 19 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 20 | [Contact][contact] us! 21 | 22 | [zig]: https://ziglang.org/download/ 23 | [docs]: https://docs.nextmv.io 24 | [blog]: https://www.nextmv.io/blog 25 | [contact]: https://www.nextmv.io/contact 26 | -------------------------------------------------------------------------------- /go-highs-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: go 3 | runtime: ghcr.io/nextmv-io/runtime/default:latest 4 | 5 | # Directives to build a Go binary from the app. 6 | build: 7 | command: go build -o main . 8 | environment: 9 | GOOS: linux 10 | GOARCH: arm64 11 | CGO_ENABLED: 1 12 | CC: "zig cc -target aarch64-linux-musl" 13 | 14 | # List all files/directories that should be included in the app. Globbing 15 | # (e.g.: configs/*.json) is supported. 16 | files: 17 | - main 18 | -------------------------------------------------------------------------------- /go-highs-knapsack/go.mod: -------------------------------------------------------------------------------- 1 | module example.com/your_project/go-highs-knapsack 2 | 3 | go 1.22 4 | 5 | require ( 6 | github.com/nextmv-io/go-highs v1.6.0 7 | github.com/nextmv-io/go-mip v1.6.0 8 | github.com/nextmv-io/sdk v1.8.0 9 | ) 10 | 11 | require ( 12 | github.com/danielgtaylor/huma v1.14.2 // indirect 13 | github.com/google/uuid v1.6.0 // indirect 14 | github.com/gorilla/schema v1.4.1 // indirect 15 | github.com/iancoleman/strcase v0.3.0 // indirect 16 | github.com/itzg/go-flagsfiller v1.14.0 // indirect 17 | github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect 18 | github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect 19 | github.com/xeipuuv/gojsonschema v1.2.0 // indirect 20 | ) 21 | -------------------------------------------------------------------------------- /go-highs-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /go-highs-orderfulfillment/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Go", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/default:latest", 7 | "features": { 8 | "ghcr.io/devcontainers/features/go:1": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /go-highs-orderfulfillment/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: go 3 | runtime: ghcr.io/nextmv-io/runtime/default:latest 4 | 5 | # Directives to build a Go binary from the app. 6 | build: 7 | command: go build -o main . 8 | environment: 9 | GOOS: linux 10 | GOARCH: arm64 11 | CGO_ENABLED: 1 12 | CC: "zig cc -target aarch64-linux-musl" 13 | 14 | # List all files/directories that should be included in the app. Globbing 15 | # (e.g.: configs/*.json) is supported. 16 | files: 17 | - main 18 | -------------------------------------------------------------------------------- /go-highs-orderfulfillment/go-highs.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "name": "Go debug", 11 | "type": "go", 12 | "request": "launch", 13 | "mode": "auto", 14 | // this has to point the directory (NOT the file or debugging 15 | // won't work!) which contains the file which has the main 16 | // method 17 | "program": "${workspaceFolder}", 18 | "args": [ 19 | "-runner.input.path", 20 | "input.json", 21 | "-runner.output.path", 22 | "output.json" 23 | ] 24 | } 25 | ] 26 | }, 27 | "extensions": { 28 | "recommendations": ["ms-vscode-remote.remote-containers"] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /go-highs-orderfulfillment/go.mod: -------------------------------------------------------------------------------- 1 | module example.com/your_project/go-highs-orderfulfillment 2 | 3 | go 1.22 4 | 5 | require ( 6 | github.com/nextmv-io/go-highs v1.6.0 7 | github.com/nextmv-io/go-mip v1.6.0 8 | github.com/nextmv-io/sdk v1.8.0 9 | ) 10 | 11 | require ( 12 | github.com/danielgtaylor/huma v1.14.2 // indirect 13 | github.com/google/uuid v1.6.0 // indirect 14 | github.com/gorilla/schema v1.4.1 // indirect 15 | github.com/iancoleman/strcase v0.3.0 // indirect 16 | github.com/itzg/go-flagsfiller v1.14.0 // indirect 17 | github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect 18 | github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect 19 | github.com/xeipuuv/gojsonschema v1.2.0 // indirect 20 | ) 21 | -------------------------------------------------------------------------------- /go-highs-shiftscheduling/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Go HiGHS Shift Scheduling 2 | 3 | Example for running a Go application on the Nextmv Platform using the HiGHS 4 | solver. We solve an shift scheduling problem. 5 | 6 | 1. Run the app. 7 | 8 | ```bash 9 | go run . -runner.input.path input.json \ 10 | -runner.output.path output.json -solve.duration 10s 11 | ``` 12 | 13 | To push your app to the Nextmv platform via `nextmv app push ...`, you will 14 | need to have [zig][zig] installed and available on your `$PATH`. 15 | 16 | ## Next steps 17 | 18 | * Open `main.go` and modify the model. 19 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 20 | [Contact][contact] us! 21 | 22 | [zig]: https://ziglang.org/download/ 23 | [docs]: https://docs.nextmv.io 24 | [blog]: https://www.nextmv.io/blog 25 | [contact]: https://www.nextmv.io/contact 26 | -------------------------------------------------------------------------------- /go-highs-shiftscheduling/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: go 3 | runtime: ghcr.io/nextmv-io/runtime/default:latest 4 | 5 | # Directives to build a Go binary from the app. 6 | build: 7 | command: go build -o main . 8 | environment: 9 | GOOS: linux 10 | GOARCH: arm64 11 | CGO_ENABLED: 1 12 | CC: "zig cc -target aarch64-linux-musl" 13 | 14 | # List all files/directories that should be included in the app. Globbing 15 | # (e.g.: configs/*.json) is supported. 16 | files: 17 | - main 18 | -------------------------------------------------------------------------------- /go-highs-shiftscheduling/go.mod: -------------------------------------------------------------------------------- 1 | module example.com/your_project/go-highs-shiftscheduling 2 | 3 | go 1.22 4 | 5 | require ( 6 | github.com/nextmv-io/go-highs v1.6.0 7 | github.com/nextmv-io/go-mip v1.6.0 8 | github.com/nextmv-io/sdk v1.8.0 9 | ) 10 | 11 | require ( 12 | github.com/danielgtaylor/huma v1.14.2 // indirect 13 | github.com/google/uuid v1.6.0 // indirect 14 | github.com/gorilla/schema v1.4.1 // indirect 15 | github.com/iancoleman/strcase v0.3.0 // indirect 16 | github.com/itzg/go-flagsfiller v1.14.0 // indirect 17 | github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect 18 | github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect 19 | github.com/xeipuuv/gojsonschema v1.2.0 // indirect 20 | ) 21 | -------------------------------------------------------------------------------- /go-nextroute/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Go Nextroute 2 | 3 | Example for running a Go application on the Nextmv Platform using the 4 | `Nextroute` vehicle routing problem solver. 5 | 6 | 1. Run the app. 7 | 8 | ```bash 9 | go run . -runner.input.path input.json \ 10 | -runner.output.path output.json -solve.duration 10s 11 | ``` 12 | 13 | ## Next steps 14 | 15 | * Open `main.go` and modify the model. 16 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 17 | [Contact][contact] us! 18 | 19 | [docs]: https://docs.nextmv.io 20 | [blog]: https://www.nextmv.io/blog 21 | [contact]: https://www.nextmv.io/contact 22 | -------------------------------------------------------------------------------- /go-nextroute/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: go 3 | runtime: ghcr.io/nextmv-io/runtime/default:latest 4 | 5 | # Directives to build a Go binary from the app. 6 | build: 7 | command: go build -o main . 8 | environment: 9 | GOOS: linux 10 | GOARCH: arm64 11 | 12 | # List all files/directories that should be included in the app. Globbing 13 | # (e.g.: configs/*.json) is supported. 14 | files: 15 | - main 16 | -------------------------------------------------------------------------------- /go-nextroute/go.mod: -------------------------------------------------------------------------------- 1 | module example.com/your_project/go-nextroute 2 | 3 | go 1.22 4 | 5 | require ( 6 | github.com/nextmv-io/nextroute v1.11.4 7 | github.com/nextmv-io/sdk v1.8.3-0.20241219091227-002f36a342d6 8 | ) 9 | 10 | require ( 11 | github.com/danielgtaylor/huma v1.14.2 // indirect 12 | github.com/google/uuid v1.6.0 // indirect 13 | github.com/gorilla/schema v1.4.1 // indirect 14 | github.com/iancoleman/strcase v0.3.0 // indirect 15 | github.com/itzg/go-flagsfiller v1.14.0 // indirect 16 | github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect 17 | github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect 18 | github.com/xeipuuv/gojsonschema v1.2.0 // indirect 19 | golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect 20 | gonum.org/v1/gonum v0.15.0 // indirect 21 | ) 22 | -------------------------------------------------------------------------------- /java-gurobi-knapsack/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Java", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/java:latest", 7 | "features": { 8 | "ghcr.io/devcontainers/features/java:1": { 9 | "installMaven": "true", 10 | "jdkDistro": "tem", 11 | "version": "21" 12 | } 13 | }, 14 | "workspaceMount": "source=${localWorkspaceFolder}/.,target=/app,type=bind", 15 | "workspaceFolder": "/app", 16 | "containerEnv": { 17 | "GRB_LICENSE_FILE": "./gurobi.lic" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /java-gurobi-knapsack/.gitignore: -------------------------------------------------------------------------------- 1 | gurobi.lic 2 | -------------------------------------------------------------------------------- /java-gurobi-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: java 3 | runtime: ghcr.io/nextmv-io/runtime/java:latest 4 | 5 | # Directives to compile a binary from the app. 6 | pre-push: mvn package 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.jar 12 | -------------------------------------------------------------------------------- /java-gurobi-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /java-gurobi-knapsack/java-gurobi-knapsack.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "type": "java", 11 | "name": "Main", 12 | "request": "launch", 13 | "mainClass": "com.nextmv.example.Main", 14 | "projectName": "GurobiJava", 15 | "env": { 16 | "GRB_LICENSE_FILE": "gurobi.lic" 17 | }, 18 | "args": ["--input", "input.json", "--output", "output.json"] 19 | } 20 | ] 21 | }, 22 | "extensions": { 23 | "recommendations": ["ms-vscode-remote.remote-containers"] 24 | }, 25 | "settings": { 26 | "java.configuration.updateBuildConfiguration": "interactive" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /java-gurobi-knapsack/src/main/java/com/nextmv/example/Item.java: -------------------------------------------------------------------------------- 1 | package com.nextmv.example; 2 | 3 | public class Item { 4 | private final String id; 5 | private final double weight; 6 | private final double value; 7 | 8 | public Item(String id, double weight, double value) { 9 | this.id = id; 10 | this.weight = weight; 11 | this.value = value; 12 | } 13 | 14 | public String getId() { 15 | return this.id; 16 | } 17 | 18 | public double getWeight() { 19 | return this.weight; 20 | } 21 | 22 | public double getValue() { 23 | return this.value; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java-hello-world/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Java Hello World 2 | 3 | Simple example for running a Java `Maven` application on the Nextmv Platform. 4 | 5 | 1. Generate a `main.jar`. 6 | 7 | ```bash 8 | mvn package 9 | ``` 10 | 11 | 2. Run the app. 12 | 13 | ```bash 14 | cat input.json | java -jar main.jar 15 | ``` 16 | 17 | ## Next steps 18 | 19 | * Open `Main.java` and start writing the model. 20 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 21 | [Contact][contact] us! 22 | 23 | [docs]: https://docs.nextmv.io 24 | [blog]: https://www.nextmv.io/blog 25 | [contact]: https://www.nextmv.io/contact 26 | -------------------------------------------------------------------------------- /java-hello-world/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: java 3 | runtime: ghcr.io/nextmv-io/runtime/java:latest 4 | 5 | # Directives to compile a binary from the app. 6 | pre-push: mvn package 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.jar 12 | -------------------------------------------------------------------------------- /java-hello-world/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "world" 3 | } 4 | -------------------------------------------------------------------------------- /java-hexaly-knapsack/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Java", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/java:latest", 7 | "features": { 8 | "ghcr.io/devcontainers/features/java:1": { 9 | "installMaven": "true", 10 | "jdkDistro": "tem", 11 | "version": "21" 12 | } 13 | }, 14 | "workspaceMount": "source=${localWorkspaceFolder}/.,target=/app,type=bind", 15 | "workspaceFolder": "/app", 16 | "postAttachCommand": "mvn install:install-file -Dfile=lib/hexaly.jar -DgroupId=com.hexaly -DartifactId=hexaly -Dversion=1.0.0 -Dpackaging=jar -DgeneratePom=true" 17 | } 18 | -------------------------------------------------------------------------------- /java-hexaly-knapsack/.gitignore: -------------------------------------------------------------------------------- 1 | hexaly.jar 2 | *.so 3 | .env 4 | license.dat 5 | -------------------------------------------------------------------------------- /java-hexaly-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: java 3 | runtime: ghcr.io/nextmv-io/runtime/java:latest 4 | 5 | # Directives to compile a binary from the app. 6 | pre-push: mvn package 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.jar 12 | - lib/*.so 13 | - lib/*.jar 14 | -------------------------------------------------------------------------------- /java-hexaly-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /java-hexaly-knapsack/java-hexaly-knapsack.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "type": "java", 11 | "name": "Main", 12 | "request": "launch", 13 | "mainClass": "com.nextmv.example.Main", 14 | "projectName": "HexalyJava", 15 | "env": { 16 | // Set path to the local libraries for the right arch flavor. 17 | "LD_LIBRARY_PATH": "/app/local", 18 | }, 19 | "args": ["--input", "input.json", "--output", "output.json"] 20 | } 21 | ] 22 | }, 23 | "extensions": { 24 | "recommendations": ["ms-vscode-remote.remote-containers"] 25 | }, 26 | "settings": { 27 | "java.configuration.updateBuildConfiguration": "automatic" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /java-hexaly-knapsack/lib/.keep: -------------------------------------------------------------------------------- 1 | This file is used to keep the directory structure in version control systems like Git. 2 | -------------------------------------------------------------------------------- /java-hexaly-knapsack/local/.keep: -------------------------------------------------------------------------------- 1 | This file is used to keep the directory structure in version control systems like Git. 2 | -------------------------------------------------------------------------------- /java-hexaly-knapsack/src/main/java/com/nextmv/example/Item.java: -------------------------------------------------------------------------------- 1 | package com.nextmv.example; 2 | 3 | public class Item { 4 | private final String id; 5 | private final double weight; 6 | private final double value; 7 | 8 | public Item(String id, double weight, double value) { 9 | this.id = id; 10 | this.weight = weight; 11 | this.value = value; 12 | } 13 | 14 | public String getId() { 15 | return this.id; 16 | } 17 | 18 | public double getWeight() { 19 | return this.weight; 20 | } 21 | 22 | public double getValue() { 23 | return this.value; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java-ortools-knapsack/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Java", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/java:latest", 7 | "features": { 8 | "ghcr.io/devcontainers/features/java:1": { 9 | "installMaven": "true", 10 | "jdkDistro": "tem", 11 | "version": "21" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /java-ortools-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: java 3 | runtime: ghcr.io/nextmv-io/runtime/java:latest 4 | 5 | # Directives to compile a binary from the app. 6 | pre-push: mvn package 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.jar 12 | -------------------------------------------------------------------------------- /java-ortools-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /java-ortools-knapsack/java-ortools.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "type": "java", 11 | "name": "Main", 12 | "request": "launch", 13 | "mainClass": "com.nextmv.example.Main", 14 | "projectName": "ORToolsJava", 15 | "args": ["--input", "input.json", "--output", "output.json"] 16 | } 17 | ] 18 | }, 19 | "extensions": { 20 | "recommendations": ["ms-vscode-remote.remote-containers"] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /java-ortools-knapsack/src/main/java/com/nextmv/example/Item.java: -------------------------------------------------------------------------------- 1 | package com.nextmv.example; 2 | 3 | public class Item { 4 | private final String id; 5 | private final double weight; 6 | private final double value; 7 | 8 | public Item(String id, double weight, double value) { 9 | this.id = id; 10 | this.weight = weight; 11 | this.value = value; 12 | } 13 | 14 | public String getId() { 15 | return this.id; 16 | } 17 | 18 | public double getWeight() { 19 | return this.weight; 20 | } 21 | 22 | public double getValue() { 23 | return this.value; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java-ortools-routing/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Java", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/java:latest", 7 | "features": { 8 | "ghcr.io/devcontainers/features/java:1": { 9 | "installMaven": "true", 10 | "jdkDistro": "tem", 11 | "version": "21" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /java-ortools-routing/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Java OR-Tools Routing 2 | 3 | Example for running a Java `Maven` application on the Nextmv Platform using the 4 | OR-Tools package. We solve a vehicle routing problem. 5 | 6 | 1. Generate a `main.jar`. 7 | 8 | ```bash 9 | mvn package 10 | ``` 11 | 12 | 1. Run the app. 13 | 14 | ```bash 15 | java -jar main.jar --input input.json 16 | ``` 17 | 18 | ## Mirror running on Nextmv Cloud locally 19 | 20 | Docker needs to be installed. 21 | 22 | To run the application in the same Docker image as the one used on Nextmv 23 | Cloud, you can use the following command: 24 | 25 | ```bash 26 | mvn package && cat input.json | docker run -i --rm \ 27 | -v $(pwd):/app ghcr.io/nextmv-io/runtime/java:latest \ 28 | java -jar /app/main.jar 29 | ``` 30 | 31 | You can also debug the application by running it in a Dev Container. This 32 | workspace recommends to install the Dev Container extension for VSCode. If you 33 | have the extension installed, you can open the workspace in a container by using 34 | the command `Dev Containers: Reopen in Container`. 35 | 36 | ## Next steps 37 | 38 | * Open `src/main/java/com/nextmv/example/Main.java` and modify the model. 39 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 40 | [Contact][contact] us! 41 | 42 | [docs]: https://docs.nextmv.io 43 | [blog]: https://www.nextmv.io/blog 44 | [contact]: https://www.nextmv.io/contact 45 | -------------------------------------------------------------------------------- /java-ortools-routing/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: java 3 | runtime: ghcr.io/nextmv-io/runtime/java:latest 4 | 5 | # Directives to compile a binary from the app. 6 | pre-push: mvn package 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.jar 12 | -------------------------------------------------------------------------------- /java-ortools-routing/java-ortools.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "type": "java", 11 | "name": "Main", 12 | "request": "launch", 13 | "mainClass": "com.nextmv.example.Main", 14 | "projectName": "ORToolsJava", 15 | "args": ["--input", "input.json", "--output", "output.json"] 16 | } 17 | ] 18 | }, 19 | "extensions": { 20 | "recommendations": ["ms-vscode-remote.remote-containers"] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /java-ortools-routing/src/main/java/com/nextmv/example/Vehicle.java: -------------------------------------------------------------------------------- 1 | package com.nextmv.example; 2 | 3 | import java.util.List; 4 | 5 | public class Vehicle { 6 | public final int vehicle; 7 | public final double distance; 8 | public final List stops; 9 | 10 | public Vehicle(int vehicle, double distance, List stops) { 11 | this.vehicle = vehicle; 12 | this.distance = distance; 13 | this.stops = stops; 14 | } 15 | 16 | public int getVehicle() { 17 | return this.vehicle; 18 | } 19 | 20 | public double getDistance() { 21 | return this.distance; 22 | } 23 | 24 | public List getStops() { 25 | return this.stops; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /python-ampl-facilitylocation/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Python", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/ampl:latest", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": ["ms-python.debugpy", "ms-python.python"], 10 | "settings": { 11 | "python.defaultInterpreterPath": "python" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /python-ampl-facilitylocation/ampl_license_uuid.template: -------------------------------------------------------------------------------- 1 | secret-key-123 2 | -------------------------------------------------------------------------------- /python-ampl-facilitylocation/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | - floc_bend.mod 13 | - floc_bend.run 14 | # If you have an AMPL license, uncomment the following line and make sure to 15 | # store your license information in that file. 16 | # - ampl_license_uuid 17 | -------------------------------------------------------------------------------- /python-ampl-facilitylocation/python-ampl.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "name": "Python: Module", 11 | "type": "debugpy", 12 | "request": "launch", 13 | "module": "main", 14 | "justMyCode": true, 15 | "args": [ 16 | "-input", 17 | "input.json", 18 | "-output", 19 | "output.json", 20 | "-provider", 21 | "highs", 22 | "-duration", 23 | "5", 24 | "-modelpath", 25 | ".", 26 | "-runpath", 27 | "." 28 | ] 29 | } 30 | ] 31 | }, 32 | "extensions": { 33 | "recommendations": ["ms-vscode-remote.remote-containers"] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /python-ampl-facilitylocation/requirements.txt: -------------------------------------------------------------------------------- 1 | # Look for AMPL’s packages in the AMPL package index. 2 | --index-url https://pypi.ampl.com 3 | --extra-index-url https://pypi.org/simple 4 | 5 | amplpy==0.14.0 6 | ampltools==0.7.5 7 | ampl-module-base==20241203 8 | ampl-module-copt==20241228 9 | ampl-module-cbc==20250206 10 | ampl-module-gcg==20240724 11 | ampl-module-gecode==20220504 12 | ampl-module-gokestrel==20211022 13 | ampl-module-gurobi==20250204 14 | ampl-module-highs==20241119 15 | ampl-module-lgo==20190908 16 | ampl-module-open==20250206 17 | ampl-module-scip==20240724 18 | ampl-module-xpress==20241227 19 | 20 | nextmv==0.26.3 21 | pandas==2.2.2 22 | -------------------------------------------------------------------------------- /python-ampl-knapsack/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python AMPL Knapsack 2 | 3 | Example for running a Python application on the Nextmv Platform using the AMPL 4 | package. We solve a knapsack Mixed Integer Programming problem. 5 | 6 | If you have an AMPL license, remove the `.template` extension from the 7 | `ampl_license_uuid.template` file and replace the contents with your actual 8 | license key. Modify the `app.yaml` file to include the `ampl_license_uuid` in 9 | the files list. 10 | 11 | 1. Install packages. 12 | 13 | ```bash 14 | pip3 install -r requirements.txt 15 | ``` 16 | 17 | 1. Run the app. 18 | 19 | ```bash 20 | python3 main.py -input input.json -output output.json \ 21 | -duration 30 -provider highs 22 | ``` 23 | 24 | ## Next steps 25 | 26 | * Open `main.py` and modify the model. 27 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 28 | [Contact][contact] us! 29 | 30 | [docs]: https://docs.nextmv.io 31 | [blog]: https://www.nextmv.io/blog 32 | [contact]: https://www.nextmv.io/contact 33 | -------------------------------------------------------------------------------- /python-ampl-knapsack/ampl_license_uuid.template: -------------------------------------------------------------------------------- 1 | secret-key-123 2 | -------------------------------------------------------------------------------- /python-ampl-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | # If you have an AMPL license, uncomment the following line and make sure to 13 | # store your license information in that file. 14 | # - ampl_license_uuid 15 | -------------------------------------------------------------------------------- /python-ampl-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /python-ampl-knapsack/requirements.txt: -------------------------------------------------------------------------------- 1 | # Look for AMPL’s packages in the AMPL package index. 2 | --index-url https://pypi.ampl.com 3 | --extra-index-url https://pypi.org/simple 4 | 5 | amplpy==0.14.0 6 | ampltools==0.7.5 7 | ampl-module-base==20241203 8 | ampl-module-copt==20241228 9 | ampl-module-cbc==20250206 10 | ampl-module-gcg==20240724 11 | ampl-module-gecode==20220504 12 | ampl-module-gokestrel==20211022 13 | ampl-module-gurobi==20250204 14 | ampl-module-highs==20241119 15 | ampl-module-lgo==20190908 16 | ampl-module-open==20250206 17 | ampl-module-scip==20240724 18 | ampl-module-xpress==20241227 19 | 20 | nextmv==0.26.3 21 | -------------------------------------------------------------------------------- /python-ampl-priceoptimization/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Python", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/ampl:latest", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": ["ms-python.debugpy", "ms-python.python"], 10 | "settings": { 11 | "python.defaultInterpreterPath": "python" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /python-ampl-priceoptimization/ampl_license_uuid.template: -------------------------------------------------------------------------------- 1 | secret-key-123 2 | -------------------------------------------------------------------------------- /python-ampl-priceoptimization/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | - ampl_model.mod 13 | - visuals.py 14 | # If you have an AMPL license, uncomment the following line and make sure to 15 | # store your license information in that file. 16 | # - ampl_license_uuid 17 | -------------------------------------------------------------------------------- /python-ampl-priceoptimization/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "regions": [ 3 | "great_lakes", 4 | "midsouth", 5 | "northeast", 6 | "northern_new_england", 7 | "southcentral", 8 | "southeast", 9 | "west", 10 | "plains" 11 | ], 12 | "total_amount_of_supply": 30, 13 | "cost_per_wasted_product": 0.1, 14 | "peak": 1, 15 | "transport_costs": [0.3, 0.1, 0.4, 0.5, 0.3, 0.2, 0.2, 0.2], 16 | "year": 2024, 17 | "minimum_product_price": 0, 18 | "maximum_product_price": 2, 19 | "minimum_product_allocations": [ 20 | 2.063574, 1.845443, 2.364424, 0.21969, 3.68713, 2.197764, 3.260102, 1.058938 21 | ], 22 | "maximum_product_allocations": [ 23 | 7.094765, 6.168572, 8.836406, 0.917984, 10.323175, 7.810475, 11.274749, 24 | 3.575499 25 | ], 26 | "coefficients": { 27 | "region": [ 28 | 0, -0.242693153677881, 1.433019836643242, -3.019243790637881, 29 | 1.7138120739734646, 0.5839901666611692, 2.6017994486412657, 30 | -1.8150328723904097 31 | ], 32 | "price": -2.2037701048902467, 33 | "intercept": 5.43931005216503, 34 | "year_index": 0.16076930231844555, 35 | "peak": 0.548510505830839 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /python-ampl-priceoptimization/python-ampl.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "name": "Python: Module", 11 | "type": "debugpy", 12 | "request": "launch", 13 | "module": "main", 14 | "justMyCode": true, 15 | "args": [ 16 | "-input", 17 | "input.json", 18 | "-output", 19 | "output.json", 20 | "-provider", 21 | "highs", 22 | "-duration", 23 | "5", 24 | "-model", 25 | "." 26 | ] 27 | } 28 | ] 29 | }, 30 | "extensions": { 31 | "recommendations": ["ms-vscode-remote.remote-containers"] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /python-ampl-priceoptimization/requirements.txt: -------------------------------------------------------------------------------- 1 | # Look for AMPL’s packages in the AMPL package index. 2 | --index-url https://pypi.ampl.com 3 | --extra-index-url https://pypi.org/simple 4 | 5 | amplpy==0.14.0 6 | ampltools==0.7.5 7 | ampl-module-base==20241203 8 | ampl-module-copt==20241228 9 | ampl-module-cbc==20250206 10 | ampl-module-gcg==20240724 11 | ampl-module-gecode==20220504 12 | ampl-module-gokestrel==20211022 13 | ampl-module-gurobi==20250204 14 | ampl-module-highs==20241119 15 | ampl-module-lgo==20190908 16 | ampl-module-open==20250206 17 | ampl-module-scip==20240724 18 | ampl-module-xpress==20241227 19 | 20 | nextmv==0.26.3 21 | plotly==6.0.0 22 | -------------------------------------------------------------------------------- /python-gurobi-knapsack/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python Gurobi Knapsack 2 | 3 | Example for running a Python application on the Nextmv Platform using the 4 | Gurobi solver. We solve a knapsack Mixed Integer Programming problem. 5 | 6 | If you have a Gurobi WSL license, remove the `.template` extension from the 7 | `gurobi.lic.template` file and replace the contents with your actual license 8 | key. Modify the `app.yaml` file to include the `gurobi.lic` in the files list. 9 | 10 | 1. Install packages. 11 | 12 | ```bash 13 | pip3 install -r requirements.txt 14 | ``` 15 | 16 | 1. Run the app. 17 | 18 | ```bash 19 | python3 main.py -input input.json -output output.json -duration 30 20 | ``` 21 | 22 | Alternatively, you may reference the `main.ipynb` Jupyter notebook which, in 23 | addition to running locally, showcases how to push the app and run it remotely. 24 | 25 | ## Next steps 26 | 27 | * Open `main.py` and modify the model. 28 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 29 | [Contact][contact] us! 30 | 31 | [docs]: https://docs.nextmv.io 32 | [blog]: https://www.nextmv.io/blog 33 | [contact]: https://www.nextmv.io/contact 34 | -------------------------------------------------------------------------------- /python-gurobi-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | # If you have a Gurobi license, uncomment the following line and make sure to 13 | # store your license information in that file. 14 | # - gurobi.lic 15 | -------------------------------------------------------------------------------- /python-gurobi-knapsack/gurobi.lic.template: -------------------------------------------------------------------------------- 1 | WLSACCESSID=secret-123 2 | WLSSECRET=secret-123 3 | LICENSEID=123 4 | -------------------------------------------------------------------------------- /python-gurobi-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /python-gurobi-knapsack/requirements.txt: -------------------------------------------------------------------------------- 1 | gurobipy==11.0.0 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-gurobi-price-optimization/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv & Gurobi Price Optimization 2 | 3 | This community app contains a Jupyter Notebook that demonstrates how to 4 | Nextmvify the [Gurobi Avocado Price Optimization notebook][original]. 5 | 6 | ## Next steps 7 | 8 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 9 | [Contact][contact] us! 10 | 11 | [original]: 12 | https://colab.research.google.com/github/Gurobi/modeling-examples/blob/master/price_optimization/price_optimization.ipynb 13 | [docs]: https://docs.nextmv.io 14 | [blog]: https://www.nextmv.io/blog 15 | [contact]: https://www.nextmv.io/contact 16 | -------------------------------------------------------------------------------- /python-hello-world/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python Hello World 2 | 3 | Simple example for running a Python application on the Nextmv Platform. 4 | 5 | 1. Install packages. 6 | 7 | ```bash 8 | pip3 install -r requirements.txt 9 | ``` 10 | 11 | 1. Run the app. 12 | 13 | ```bash 14 | cat input.json | python3 main.py 15 | ``` 16 | 17 | ## Next steps 18 | 19 | * Open `main.py` and start writing the model. 20 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 21 | [Contact][contact] us! 22 | 23 | [docs]: https://docs.nextmv.io 24 | [blog]: https://www.nextmv.io/blog 25 | [contact]: https://www.nextmv.io/contact 26 | -------------------------------------------------------------------------------- /python-hello-world/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | - visuals.py 13 | -------------------------------------------------------------------------------- /python-hello-world/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "world", 3 | "radius": 6378, 4 | "distance": 147.6 5 | } 6 | -------------------------------------------------------------------------------- /python-hello-world/main.py: -------------------------------------------------------------------------------- 1 | import nextmv 2 | from visuals import create_visuals 3 | 4 | # Read the input from stdin. 5 | input = nextmv.load() 6 | name = input.data["name"] 7 | 8 | options = nextmv.Options( 9 | nextmv.Option("details", bool, True, "Print details to logs. Default true.", False), 10 | ) 11 | 12 | ##### Insert model here 13 | 14 | # Print logs that render in the run view in Nextmv Console. 15 | message = f"Hello, {name}" 16 | nextmv.log(message) 17 | 18 | if options.details: 19 | detail = "You are", {input.data["distance"]}, " million km from the sun" 20 | nextmv.log(detail) 21 | 22 | assets = create_visuals(name, input.data["radius"], input.data["distance"]) 23 | 24 | # Write output and statistics. 25 | output = nextmv.Output( 26 | solution=None, 27 | statistics=nextmv.Statistics( 28 | result=nextmv.ResultStatistics( 29 | value=1.23, 30 | custom={"message": message}, 31 | ), 32 | ), 33 | assets=assets, 34 | ) 35 | nextmv.write(output) 36 | -------------------------------------------------------------------------------- /python-hello-world/requirements.txt: -------------------------------------------------------------------------------- 1 | # Define the packages required by your project here. 2 | nextmv==0.26.3 3 | plotly==6.0.0 4 | -------------------------------------------------------------------------------- /python-hello-world/visuals.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | import nextmv 4 | import plotly.graph_objects as go 5 | 6 | 7 | def create_visuals(name: str, radius: float, distance: float) -> list[nextmv.Asset]: 8 | """Create a Plotly bar chart with radius and distance for a planet.""" 9 | 10 | fig = go.Figure() 11 | fig.add_trace( 12 | go.Bar(x=[name], y=[radius], name="Radius (km)", marker_color="red", opacity=0.5), 13 | ) 14 | fig.add_trace( 15 | go.Bar(x=[name], y=[distance], name="Distance (Millions km)", marker_color="blue", opacity=0.5), 16 | ) 17 | fig.update_layout( 18 | title="Radius and Distance by Planet", xaxis_title="Planet", yaxis_title="Values", barmode="group" 19 | ) 20 | fig = fig.to_json() 21 | 22 | assets = [ 23 | nextmv.Asset( 24 | name="Plotly example", 25 | content_type="json", 26 | visual=nextmv.Visual( 27 | visual_schema=nextmv.VisualSchema.PLOTLY, 28 | visual_type="custom-tab", 29 | label="Charts", 30 | ), 31 | content=[json.loads(fig)], 32 | ) 33 | ] 34 | 35 | return assets 36 | -------------------------------------------------------------------------------- /python-hexaly-knapsack/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Python", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/hexaly:latest", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": ["ms-python.debugpy", "ms-python.python"], 10 | "settings": { 11 | "python.defaultInterpreterPath": "python" 12 | } 13 | } 14 | }, 15 | "postCreateCommand": "pip install -r requirements.txt" 16 | } 17 | -------------------------------------------------------------------------------- /python-hexaly-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/hexaly:latest 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | # If you have a Hexaly license, uncomment the following line and make sure to 13 | # store your license information in that file. 14 | # - license.dat 15 | -------------------------------------------------------------------------------- /python-hexaly-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /python-hexaly-knapsack/license.dat.template: -------------------------------------------------------------------------------- 1 | CLOUD_KEY = secret-123 2 | CLOUD_SECRET = secret 3 | 4 | [DEFAULT_PARAMETERS] 5 | verbosity = 0 6 | -------------------------------------------------------------------------------- /python-hexaly-knapsack/requirements.txt: -------------------------------------------------------------------------------- 1 | # Look for Hexaly’s packages in the Hexaly package index. 2 | --index-url https://pip.hexaly.com 3 | --extra-index-url https://pypi.org/simple 4 | 5 | hexaly==13.0.20240712 6 | nextmv==0.26.3 7 | -------------------------------------------------------------------------------- /python-highs-knapsack/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python HiGHS Knapsack 2 | 3 | Example for running a Python application on the Nextmv Platform using the HiGHS 4 | solver. We solve a knapsack Mixed Integer Programming problem. 5 | 6 | 1. Install packages. 7 | 8 | ```bash 9 | pip3 install -r requirements.txt 10 | ``` 11 | 12 | 1. Run the app. 13 | 14 | ```bash 15 | python3 main.py -input input.json -output output.json -duration 30 16 | ``` 17 | 18 | Alternatively, you may reference the `main.ipynb` Jupyter notebook which, in 19 | addition to running locally, showcases how to push the app and run it remotely. 20 | 21 | ## Next steps 22 | 23 | * Open `main.py` and modify the model. 24 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 25 | [Contact][contact] us! 26 | 27 | [docs]: https://docs.nextmv.io 28 | [blog]: https://www.nextmv.io/blog 29 | [contact]: https://www.nextmv.io/contact 30 | -------------------------------------------------------------------------------- /python-highs-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | -------------------------------------------------------------------------------- /python-highs-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /python-highs-knapsack/requirements.txt: -------------------------------------------------------------------------------- 1 | highspy==1.9.0 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-nextmv-gurobipy-knapsack/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv & gurobipy Python Integration - Knapsack 2 | 3 | Example for running a Python application on the Nextmv Platform using the 4 | `nextmv-gurobipy` package. We solve a knapsack Mixed Integer Programming problem. 5 | 6 | If you have a Gurobi WSL license, remove the `.template` extension from the 7 | `gurobi.lic.template` file and replace the contents with your actual license 8 | key. Modify the `app.yaml` file to include the `gurobi.lic` in the files list. 9 | 10 | 1. Install packages. 11 | 12 | ```bash 13 | pip3 install -r requirements.txt 14 | ``` 15 | 16 | 2. Run the app. 17 | 18 | ```bash 19 | python3 main.py -input input.json -output output.json -TimeLimit 30 20 | ``` 21 | 22 | Alternatively, you may reference the `main.ipynb` Jupyter notebook which, in 23 | addition to running locally, showcases how to push the app and run it remotely. 24 | 25 | ## Next steps 26 | 27 | * Open `main.py` and modify the model. 28 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 29 | [Contact][contact] us! 30 | 31 | [docs]: https://docs.nextmv.io 32 | [blog]: https://www.nextmv.io/blog 33 | [contact]: https://www.nextmv.io/contact 34 | -------------------------------------------------------------------------------- /python-nextmv-gurobipy-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | # If you have a Gurobi license, uncomment the following line and make sure to 13 | # store your license information in that file. 14 | # - gurobi.lic 15 | -------------------------------------------------------------------------------- /python-nextmv-gurobipy-knapsack/gurobi.lic.template: -------------------------------------------------------------------------------- 1 | WLSACCESSID=secret-123 2 | WLSSECRET=secret-123 3 | LICENSEID=123 4 | -------------------------------------------------------------------------------- /python-nextmv-gurobipy-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /python-nextmv-gurobipy-knapsack/requirements.txt: -------------------------------------------------------------------------------- 1 | nextmv-gurobipy==0.3.0 2 | -------------------------------------------------------------------------------- /python-nextmv-scikit-learn-diabetes/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv & scikit-learn Diabetes 2 | 3 | This community app contains a Jupyter Notebook that demonstrates how to use the 4 | `nextmv-scikit-learn` package, which was created to facilitate the integration 5 | of Nextmv and scikit-learn. 6 | 7 | The classical diabetes dataset is used with different regressors to: 8 | 9 | 1. train a scikit-learn model, 10 | 2. fit it, 11 | 3. export the fitted model (solution), 12 | 4. import the model, 13 | 5. make predictions. 14 | 15 | The notebook showcases how to achieve this, step by step. 16 | 17 | ## Next steps 18 | 19 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 20 | [Contact][contact] us! 21 | 22 | [docs]: https://docs.nextmv.io 23 | [blog]: https://www.nextmv.io/blog 24 | [contact]: https://www.nextmv.io/contact 25 | -------------------------------------------------------------------------------- /python-nextroute/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python Nextroute 2 | 3 | Example for running a Python application on the Nextmv Platform using the 4 | `Nextroute` vehicle routing problem solver. 5 | 6 | 1. Install packages. 7 | 8 | ```bash 9 | pip3 install -r requirements.txt 10 | ``` 11 | 12 | 1. Run the app. 13 | 14 | ```bash 15 | python3 main.py -input input.json -output output.json \ 16 | -solve_duration 10 17 | ``` 18 | 19 | Alternatively, you may reference the `main.ipynb` Jupyter notebook which, in 20 | addition to running locally, showcases how to push the app and run it remotely. 21 | 22 | ## Next steps 23 | 24 | * Open `main.py` and modify the model. 25 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 26 | [Contact][contact] us! 27 | 28 | [docs]: https://docs.nextmv.io 29 | [blog]: https://www.nextmv.io/blog 30 | [contact]: https://www.nextmv.io/contact 31 | -------------------------------------------------------------------------------- /python-nextroute/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-nextroute/requirements.txt: -------------------------------------------------------------------------------- 1 | nextroute==1.11.4 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-ortools-costflow/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python OR-Tools Cost Flow 2 | 3 | Example for running a Python application on the Nextmv Platform using the 4 | OR-Tools package. We solve a minimum cost flow problem for assigning workers to 5 | projects. 6 | 7 | 1. Install packages. 8 | 9 | ```bash 10 | pip3 install -r requirements.txt 11 | ``` 12 | 13 | 1. Run the app. 14 | 15 | ```bash 16 | python3 main.py -input input.json -output output.json \ 17 | -duration 30 -penalty 3000 18 | ``` 19 | 20 | ## Next steps 21 | 22 | * Open `main.py` and modify the model. 23 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 24 | [Contact][contact] us! 25 | 26 | [docs]: https://docs.nextmv.io 27 | [blog]: https://www.nextmv.io/blog 28 | [contact]: https://www.nextmv.io/contact 29 | -------------------------------------------------------------------------------- /python-ortools-costflow/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-ortools-costflow/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ 3 | { 4 | "id": "project-1", 5 | "required_skills": ["programming"], 6 | "value": 3000, 7 | "required_time": 2 8 | }, 9 | { 10 | "id": "project-2", 11 | "required_skills": ["programming", "design"], 12 | "value": 4500, 13 | "required_time": 4 14 | }, 15 | { 16 | "id": "project-3", 17 | "required_skills": ["design"], 18 | "value": 3500, 19 | "required_time": 3 20 | }, 21 | { 22 | "id": "project-4", 23 | "required_skills": ["design"], 24 | "value": 2450, 25 | "required_time": 2 26 | }, 27 | { 28 | "id": "project-5", 29 | "required_skills": ["programming"], 30 | "value": 4000, 31 | "required_time": 5 32 | } 33 | ], 34 | "workers": [ 35 | { 36 | "id": "worker-1", 37 | "skills": ["programming"], 38 | "available_time": 3 39 | }, 40 | { 41 | "id": "worker-2", 42 | "skills": ["programming", "design"], 43 | "available_time": 9 44 | }, 45 | { 46 | "id": "worker-3", 47 | "skills": ["design"], 48 | "available_time": 4 49 | } 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /python-ortools-costflow/requirements.txt: -------------------------------------------------------------------------------- 1 | ortools==9.12.4544 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-ortools-demandforecasting/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Python", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/ortools:latest", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": ["ms-python.debugpy", "ms-python.python"], 10 | "settings": { 11 | "python.defaultInterpreterPath": "python" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /python-ortools-demandforecasting/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-ortools-demandforecasting/python-ortools.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "name": "Python: Module", 11 | "type": "debugpy", 12 | "request": "launch", 13 | "module": "main", 14 | "justMyCode": true, 15 | "args": [ 16 | "-input", 17 | "input.json", 18 | "-output", 19 | "output.json", 20 | "-duration", 21 | "5" 22 | ] 23 | } 24 | ] 25 | }, 26 | "extensions": { 27 | "recommendations": [ 28 | "ms-vscode-remote.remote-containers", 29 | ] 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /python-ortools-demandforecasting/requirements.txt: -------------------------------------------------------------------------------- 1 | ortools==9.12.4544 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-ortools-knapsack-multicsv/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python OR-Tools Knapsack Multi-CSV 2 | 3 | Example for running a Python application on the Nextmv Platform using the 4 | OR-Tools package and multiple CSV files. We solve a knapsack Mixed Integer 5 | Programming problem. 6 | 7 | 1. Install packages. 8 | 9 | ```bash 10 | pip3 install -r requirements.txt 11 | ``` 12 | 13 | 1. Run the app. 14 | 15 | ```bash 16 | python3 main.py -input input -output output -duration 30 -provider SCIP 17 | ``` 18 | 19 | ## Next steps 20 | 21 | * Open `main.py` and modify the model. 22 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 23 | [Contact][contact] us! 24 | 25 | [docs]: https://docs.nextmv.io 26 | [blog]: https://www.nextmv.io/blog 27 | [contact]: https://www.nextmv.io/contact 28 | -------------------------------------------------------------------------------- /python-ortools-knapsack-multicsv/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-ortools-knapsack-multicsv/input/items.csv: -------------------------------------------------------------------------------- 1 | id,value,weight 2 | cat,100,20 3 | dog,20,45 4 | water,40,2 5 | phone,6,1 6 | book,63,10 7 | rx,81,1 8 | tablet,28,8 9 | coat,44,9 10 | laptop,51,13 11 | keys,92,1 12 | nuts,18,4 13 | -------------------------------------------------------------------------------- /python-ortools-knapsack-multicsv/input/weight_capacity.csv: -------------------------------------------------------------------------------- 1 | weight_capacity 2 | 50 3 | -------------------------------------------------------------------------------- /python-ortools-knapsack-multicsv/requirements.txt: -------------------------------------------------------------------------------- 1 | ortools==9.12.4544 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-ortools-knapsack/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python OR-Tools Knapsack 2 | 3 | Example for running a Python application on the Nextmv Platform using the 4 | OR-Tools package. We solve a knapsack Mixed Integer Programming problem. 5 | 6 | 1. Install packages. 7 | 8 | ```bash 9 | pip3 install -r requirements.txt 10 | ``` 11 | 12 | 1. Run the app. 13 | 14 | ```bash 15 | python3 main.py -input inputs/input.json -output output.json \ 16 | -duration 30 -provider SCIP 17 | ``` 18 | 19 | ## Next steps 20 | 21 | * Open `main.py` and modify the model. 22 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 23 | [Contact][contact] us! 24 | 25 | [docs]: https://docs.nextmv.io 26 | [blog]: https://www.nextmv.io/blog 27 | [contact]: https://www.nextmv.io/contact 28 | -------------------------------------------------------------------------------- /python-ortools-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-ortools-knapsack/inputs/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /python-ortools-knapsack/requirements.txt: -------------------------------------------------------------------------------- 1 | ortools==9.12.4544 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-ortools-region-allocation/app.yaml: -------------------------------------------------------------------------------- 1 | type: python 2 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 3 | files: 4 | - main.py 5 | python: 6 | pip-requirements: requirements.txt 7 | -------------------------------------------------------------------------------- /python-ortools-region-allocation/requirements.txt: -------------------------------------------------------------------------------- 1 | ortools==9.12.4544 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-ortools-routing/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python OR-Tools Routing 2 | 3 | Example for running a Python application on the Nextmv Platform using the 4 | OR-Tools package. We solve a vehicle routing problem. 5 | 6 | 1. Install packages. 7 | 8 | ```bash 9 | pip3 install -r requirements.txt 10 | ``` 11 | 12 | 1. Run the app. 13 | 14 | ```bash 15 | python3 main.py -input input.json -output output.json -duration 30 16 | ``` 17 | 18 | ## Next steps 19 | 20 | * Open `main.py` and modify the model. 21 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 22 | [Contact][contact] us! 23 | 24 | [docs]: https://docs.nextmv.io 25 | [blog]: https://www.nextmv.io/blog 26 | [contact]: https://www.nextmv.io/contact 27 | -------------------------------------------------------------------------------- /python-ortools-routing/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-ortools-routing/requirements.txt: -------------------------------------------------------------------------------- 1 | ortools==9.12.4544 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-ortools-shiftassignment/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python OR-Tools Shift Assignment 2 | 3 | Example for running a Python application on the Nextmv Platform using the 4 | OR-Tools package. We solve a shift assignment Mixed Integer Programming 5 | problem. 6 | 7 | 1. Install packages. 8 | 9 | ```bash 10 | pip3 install -r requirements.txt 11 | ``` 12 | 13 | 1. Run the app. 14 | 15 | ```bash 16 | python3 main.py -input input.json -output output.json \ 17 | -duration 30 -provider SCIP 18 | ``` 19 | 20 | ## Next steps 21 | 22 | * Open `main.py` and modify the model. 23 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 24 | [Contact][contact] us! 25 | 26 | [docs]: https://docs.nextmv.io 27 | [blog]: https://www.nextmv.io/blog 28 | [contact]: https://www.nextmv.io/contact 29 | -------------------------------------------------------------------------------- /python-ortools-shiftassignment/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-ortools-shiftassignment/requirements.txt: -------------------------------------------------------------------------------- 1 | ortools==9.12.4544 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-ortools-shiftplanning/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python OR-Tools Shift Planning 2 | 3 | Example for running a Python application on the Nextmv Platform using the 4 | OR-Tools package. We solve a shift planning Mixed Integer Programming 5 | problem. 6 | 7 | 1. Install packages. 8 | 9 | ```bash 10 | pip3 install -r requirements.txt 11 | ``` 12 | 13 | 1. Run the app. 14 | 15 | ```bash 16 | python3 main.py -input input.json -output output.json \ 17 | -duration 30 -provider SCIP 18 | ``` 19 | 20 | ## Next steps 21 | 22 | * Open `main.py` and modify the model. 23 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 24 | [Contact][contact] us! 25 | 26 | [docs]: https://docs.nextmv.io 27 | [blog]: https://www.nextmv.io/blog 28 | [contact]: https://www.nextmv.io/contact 29 | -------------------------------------------------------------------------------- /python-ortools-shiftplanning/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-ortools-shiftplanning/requirements.txt: -------------------------------------------------------------------------------- 1 | ortools==9.12.4544 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-pyomo-knapsack/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Python", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/pyomo:latest", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": ["ms-python.debugpy", "ms-python.python"], 10 | "settings": { 11 | "python.defaultInterpreterPath": "python" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /python-pyomo-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/pyomo:latest 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-pyomo-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /python-pyomo-knapsack/python-pyomo.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "name": "Python: Module", 11 | "type": "debugpy", 12 | "request": "launch", 13 | "module": "main", 14 | "justMyCode": true, 15 | "args": [ 16 | "-input", 17 | "input.json", 18 | "-output", 19 | "output.json", 20 | "-provider", 21 | "cbc", 22 | "-duration", 23 | "5" 24 | ] 25 | } 26 | ] 27 | }, 28 | "extensions": { 29 | "recommendations": [ 30 | "ms-vscode-remote.remote-containers", 31 | ] 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /python-pyomo-knapsack/requirements.txt: -------------------------------------------------------------------------------- 1 | pyomo==6.8.0 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-pyomo-shiftassignment/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Python", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/pyomo:latest", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": ["ms-python.debugpy", "ms-python.python"], 10 | "settings": { 11 | "python.defaultInterpreterPath": "python" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /python-pyomo-shiftassignment/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/pyomo:latest 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-pyomo-shiftassignment/python-pyomo.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "name": "Python: Module", 11 | "type": "debugpy", 12 | "request": "launch", 13 | "module": "main", 14 | "justMyCode": true, 15 | "args": [ 16 | "-input", 17 | "input.json", 18 | "-output", 19 | "output.json", 20 | "-provider", 21 | "cbc", 22 | "-duration", 23 | "5" 24 | ] 25 | } 26 | ] 27 | }, 28 | "extensions": { 29 | "recommendations": [ 30 | "ms-vscode-remote.remote-containers", 31 | ] 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /python-pyomo-shiftassignment/requirements.txt: -------------------------------------------------------------------------------- 1 | pyomo==6.8.0 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-pyomo-shiftplanning/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Python", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/pyomo:latest", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": ["ms-python.debugpy", "ms-python.python"], 10 | "settings": { 11 | "python.defaultInterpreterPath": "python" 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /python-pyomo-shiftplanning/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/pyomo:latest 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-pyomo-shiftplanning/python-pyomo.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "name": "Python: Module", 11 | "type": "debugpy", 12 | "request": "launch", 13 | "module": "main", 14 | "justMyCode": true, 15 | "args": [ 16 | "-input", 17 | "input.json", 18 | "-output", 19 | "output.json", 20 | "-provider", 21 | "cbc", 22 | "-duration", 23 | "5" 24 | ] 25 | } 26 | ] 27 | }, 28 | "extensions": { 29 | "recommendations": [ 30 | "ms-vscode-remote.remote-containers", 31 | ] 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /python-pyomo-shiftplanning/requirements.txt: -------------------------------------------------------------------------------- 1 | pyomo==6.8.0 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-pyoptinterface-knapsack/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Python", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/python:3.11", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": ["ms-python.debugpy", "ms-python.python"], 10 | "settings": { 11 | "python.defaultInterpreterPath": "python" 12 | } 13 | } 14 | }, 15 | "postCreateCommand": "pip install -r requirements.txt" 16 | } 17 | -------------------------------------------------------------------------------- /python-pyoptinterface-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-pyoptinterface-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /python-pyoptinterface-knapsack/python-pyoptinterface.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [{ 3 | "path": "." 4 | }], 5 | "launch": { 6 | "configurations": [{ 7 | "name": "Python: Module", 8 | "type": "debugpy", 9 | "request": "launch", 10 | "module": "main", 11 | "justMyCode": true, 12 | "args": [ 13 | "-input", 14 | "input.json", 15 | "-output", 16 | "output.json", 17 | "-duration", 18 | "5" 19 | ] 20 | }] 21 | }, 22 | "extensions": { 23 | "recommendations": [ 24 | "ms-vscode-remote.remote-containers", 25 | ] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /python-pyoptinterface-knapsack/requirements.txt: -------------------------------------------------------------------------------- 1 | # pyoptinterface package with the Highs solver. 2 | pyoptinterface[highs]==0.4.0 3 | 4 | # Other packages. 5 | nextmv==0.26.3 6 | -------------------------------------------------------------------------------- /python-pyvroom-routing/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go 3 | { 4 | "name": "Python", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "ghcr.io/nextmv-io/runtime/python:3.11", 7 | "customizations": { 8 | "vscode": { 9 | "extensions": ["ms-python.debugpy", "ms-python.python"], 10 | "settings": { 11 | "python.defaultInterpreterPath": "python" 12 | } 13 | } 14 | }, 15 | "postCreateCommand": "pip install -r requirements.txt" 16 | } 17 | -------------------------------------------------------------------------------- /python-pyvroom-routing/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | # List all files/directories that should be included in the app. Globbing 5 | # (e.g.: configs/*.json) is supported. 6 | files: 7 | - main.py 8 | python: 9 | # Packages the app depends on need to be listed in a requirements.txt file 10 | # that is referenced here. All listed packages will get bundled with the app. 11 | pip-requirements: requirements.txt 12 | -------------------------------------------------------------------------------- /python-pyvroom-routing/python-pyvroom.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "launch": { 8 | "configurations": [ 9 | { 10 | "name": "Python: Module", 11 | "type": "debugpy", 12 | "request": "launch", 13 | "module": "main", 14 | "justMyCode": true, 15 | "args": [ 16 | "-input", 17 | "input.json", 18 | "-output", 19 | "output.json", 20 | "-duration", 21 | "5" 22 | ] 23 | } 24 | ] 25 | }, 26 | "extensions": { 27 | "recommendations": ["ms-vscode-remote.remote-containers"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /python-pyvroom-routing/requirements.txt: -------------------------------------------------------------------------------- 1 | pyvroom==1.14.0 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-tr-ortools-region-allocation/requirements.txt: -------------------------------------------------------------------------------- 1 | ortools==9.12.4544 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /python-wf-databricks-ml-gurobi-price-optimization/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | -------------------------------------------------------------------------------- /python-wf-databricks-ml-gurobi-price-optimization/requirements.txt: -------------------------------------------------------------------------------- 1 | nextmv==0.26.3 2 | nextpipe==0.1.3 3 | pandas==2.2.3 4 | databricks-sdk 5 | -------------------------------------------------------------------------------- /python-wf-databricks/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | -------------------------------------------------------------------------------- /python-wf-databricks/requirements.txt: -------------------------------------------------------------------------------- 1 | nextmv==0.26.3 2 | nextpipe==0.1.3 3 | pandas==2.2.3 4 | databricks-sdk 5 | -------------------------------------------------------------------------------- /python-wf-ortools-region-allocation/app.yaml: -------------------------------------------------------------------------------- 1 | type: python 2 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 3 | files: 4 | - main.py 5 | python: 6 | pip-requirements: requirements.txt 7 | -------------------------------------------------------------------------------- /python-wf-ortools-region-allocation/requirements.txt: -------------------------------------------------------------------------------- 1 | nextpipe==0.2.1 2 | nextmv==0.26.3 3 | requests==2.32.4 4 | plotly==6.1.0 5 | pandas==2.2.3 6 | -------------------------------------------------------------------------------- /python-xpress-knapsack/README.md: -------------------------------------------------------------------------------- 1 | # Nextmv Python Xpress Knapsack 2 | 3 | Example for running a Python application on the Nextmv Platform using the 4 | Xpress solver. We solve a knapsack Mixed Integer Programming problem. 5 | 6 | 1. Install packages. 7 | 8 | ```bash 9 | pip3 install -r requirements.txt 10 | ``` 11 | 12 | 2. Run the app. 13 | 14 | ```bash 15 | python3 main.py -input input.json -output output.json -duration 30 16 | ``` 17 | 18 | ## Next steps 19 | 20 | * Open `main.py` and modify the model. 21 | * Visit our [docs][docs] and [blog][blog]. Need more assistance? 22 | [Contact][contact] us! 23 | 24 | [docs]: https://docs.nextmv.io 25 | [blog]: https://www.nextmv.io/blog 26 | [contact]: https://www.nextmv.io/contact 27 | -------------------------------------------------------------------------------- /python-xpress-knapsack/app.yaml: -------------------------------------------------------------------------------- 1 | # This manifest holds the information the app needs to run on the Nextmv Cloud. 2 | type: python 3 | runtime: ghcr.io/nextmv-io/runtime/python:3.11 4 | python: 5 | # All listed packages will get bundled with the app. 6 | pip-requirements: requirements.txt 7 | 8 | # List all files/directories that should be included in the app. Globbing 9 | # (e.g.: configs/*.json) is supported. 10 | files: 11 | - main.py 12 | -------------------------------------------------------------------------------- /python-xpress-knapsack/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "items": [ 3 | { 4 | "id": "cat", 5 | "value": 100, 6 | "weight": 20 7 | }, 8 | { 9 | "id": "dog", 10 | "value": 20, 11 | "weight": 45 12 | }, 13 | { 14 | "id": "water", 15 | "value": 40, 16 | "weight": 2 17 | }, 18 | { 19 | "id": "phone", 20 | "value": 6, 21 | "weight": 1 22 | }, 23 | { 24 | "id": "book", 25 | "value": 63, 26 | "weight": 10 27 | }, 28 | { 29 | "id": "rx", 30 | "value": 81, 31 | "weight": 1 32 | }, 33 | { 34 | "id": "tablet", 35 | "value": 28, 36 | "weight": 8 37 | }, 38 | { 39 | "id": "coat", 40 | "value": 44, 41 | "weight": 9 42 | }, 43 | { 44 | "id": "laptop", 45 | "value": 51, 46 | "weight": 13 47 | }, 48 | { 49 | "id": "keys", 50 | "value": 92, 51 | "weight": 1 52 | }, 53 | { 54 | "id": "nuts", 55 | "value": 18, 56 | "weight": 4 57 | } 58 | ], 59 | "weight_capacity": 50 60 | } 61 | -------------------------------------------------------------------------------- /python-xpress-knapsack/requirements.txt: -------------------------------------------------------------------------------- 1 | xpress==9.4.2; platform_system != 'Darwin' or (platform_system == 'Darwin' and platform_machine != 'arm64') 2 | nextmv==0.26.3 3 | -------------------------------------------------------------------------------- /ruff.toml: -------------------------------------------------------------------------------- 1 | target-version="py312" 2 | 3 | # Rule selection. 4 | lint.select = [ 5 | "E", # pycodestyle errors 6 | "W", # pycodestyle warnings 7 | "F", # pyflakes 8 | "I", # isort 9 | "C", # flake8-comprehensions 10 | "B", # flake8-bugbear 11 | "UP", # pyupgrade 12 | ] 13 | 14 | # Ignore specific directories 15 | exclude = [ 16 | "python-gurobi-price-optimization", 17 | "python-wf-databricks/hello-world-nextmv-app.ipynb", 18 | "python-wf-databricks-ml-gurobi-price-optimization/avocado-price-optimizer.ipynb", 19 | "python-wf-databricks-ml-gurobi-price-optimization/avocado-ml-regressor.ipynb" 20 | ] 21 | 22 | 23 | # Rule configuration. 24 | line-length = 120 25 | 26 | # Allow generous cyclomatic complexity for examples. 27 | lint.mccabe.max-complexity = 25 28 | 29 | [lint.per-file-ignores] 30 | # Set a different max complexity for a specific file 31 | "python-ortools-shiftassignment/main.py" = ["C901"] 32 | "python-gurobi-knapsack/main.ipynb" = ["I001"] 33 | "python-highs-knapsack/main.ipynb" = ["I001"] 34 | "python-nextroute/main.ipynb" = ["I001"] 35 | --------------------------------------------------------------------------------