Skip to content

Commit

Permalink
Fixes adding pyoptinterface
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-quintero committed Sep 10, 2024
1 parent 5e3902f commit 756d24d
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestGolden(t *testing.T) {
},
ExecutionConfig: &golden.ExecutionConfig{
Command: "python3",
Args: []string{"../../../knapsack-pyoptinterface/main.py"},
Args: []string{"../../../python-pyoptinterace-knapsack/main.py"},
InputFlag: "-input",
OutputFlag: "-output",
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .nextmv/workflow-configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ apps:
app_id: python-pyomo-knapsack
marketplace_app_id: knapsack.pyomo
description: Solve a knapsack problem using Pyomo.
- name: knapsack-pyoptinterface
- name: python-pyoptinterace-knapsack
type: python
app_id:
marketplace_app_id:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ run on Nextmv Cloud.
assignment problem. Demonstrates how to use devcontainers.
* [python-pyomo-shiftplanning]: Use Python and Pyomo to solve a shift planning
problem. Demonstrates how to use devcontainers.
* [python-pyoptinterface-knapsack]: Use Python and PyOptInterface to solve a
knapsack problem. Demonstrates how to use devcontainers.
* [python-pyvroom-routing]: Use Python and Pyvroom to solve a vehicle routing
problem. Demonstrates how to use devcontainers.

Expand Down Expand Up @@ -106,3 +108,4 @@ run on Nextmv Cloud.
[python-pyomo-shiftplanning]: ./python-pyomo-shiftplanning/README.md
[python-pyvroom-routing]: ./python-pyvroom-routing/README.md
[python-xpress-knapsack]: ./python-xpress-knapsack/README.md
[python-pyoptinterface-knapsack]: ./python-pyoptinterface-knapsack/README.md
69 changes: 0 additions & 69 deletions knapsack-pyoptinterface/README.md

This file was deleted.

1 change: 0 additions & 1 deletion knapsack-pyoptinterface/VERSION

This file was deleted.

File renamed without changes.
44 changes: 44 additions & 0 deletions python-pyoptinterface-knapsack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Nextmv Python PyOptInterface Knapsack

Example for running a Python application on the Nextmv Platform using the
PyOptInterface package. We solve a knapsack Mixed Integer Programming problem.

1. Install packages.

```bash
pip3 install -r requirements.txt
```

1. Run the app.

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

## Mirror running on Nextmv Cloud locally

Docker needs to be installed.

To run the application in the same Docker image as the one used on Nextmv
Cloud, you can use the following command:

```bash
cat input.json | docker run -i --rm \
-v $(pwd):/app ghcr.io/nextmv-io/runtime/pyomo:latest \
sh -c 'python3 /app/main.py'
```

You can also debug the application by running it in a Dev Container. This
workspace recommends to install the Dev Container extension for VSCode. If you
have the extension installed, you can open the workspace in a container by
using the command `Dev Containers: Reopen in Container`.

## Next steps

* Open `main.py` and modify the model.
* Visit our [docs][docs] and [blog][blog]. Need more assistance?
[Contact][contact] us!

[docs]: https://docs.nextmv.io
[blog]: https://www.nextmv.io/blog
[contact]: https://www.nextmv.io/contact
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 756d24d

Please sign in to comment.