-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2485878
commit e482ca0
Showing
26 changed files
with
175 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
cat input.json | docker run -i --rm \ | ||
-v $(pwd):/app ghcr.io/nextmv-io/runtime/pyomo:latest \ | ||
-v $(pwd):/app ghcr.io/nextmv-io/runtime/python:latest \ | ||
sh -c 'python3 /app/main.py' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,3 @@ ampl-module-scip==20240121 | |
ampl-module-xpress==20240115 | ||
|
||
nextmv==0.12.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,3 @@ ampl-module-scip==20240121 | |
ampl-module-xpress==20240115 | ||
|
||
nextmv==0.12.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
gurobipy==11.0.0 | ||
nextmv==0.12.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,6 @@ | |
"python.defaultInterpreterPath": "python" | ||
} | ||
} | ||
} | ||
}, | ||
"postCreateCommand": "pip install -r requirements.txt" | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Nextmv Python Hexaly Knapsack | ||
|
||
Example for running a Python application on the Nextmv Platform using the | ||
Hexaly solver. We solve a knapsack Mixed Integer Programming problem. | ||
|
||
If you have a Hexaly license, remove the `.template` extension from the | ||
`license.dat.template` file and replace the contents with your actual license | ||
key. Modify the `app.yaml` file to include the `license.dat` in the files list. | ||
|
||
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/hexaly: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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
# This manifest holds the information the app needs to run on the Nextmv Cloud. | ||
type: python | ||
runtime: ghcr.io/nextmv-io/runtime/hexaly:latest | ||
python: | ||
# All listed packages will get bundled with the app. | ||
pip-requirements: requirements.txt | ||
|
||
# List all files/directories that should be included in the app. Globbing | ||
# (e.g.: configs/*.json) is supported. | ||
files: | ||
- main.py | ||
- license.dat # Store your license information in this file. | ||
python: | ||
# Packages the app depends on need to be listed in a requirements.txt file | ||
# that is referenced here. All listed packages will get bundled with the app. | ||
pip-requirements: requirements.txt | ||
# If you have a Hexaly license, uncomment the following line and make sure to | ||
# store your license information in that file. | ||
- license.dat |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.