Skip to content

Commit a176139

Browse files
committed
chore: update notebooks to use demo endpoint
1 parent 3b1d325 commit a176139

15 files changed

+7579
-3730
lines changed

resources/examples/bin-packing.ipynb

Lines changed: 226 additions & 201 deletions
Large diffs are not rendered by default.

resources/examples/consecutive-shift-scheduling.ipynb

Lines changed: 529 additions & 208 deletions
Large diffs are not rendered by default.

resources/examples/debt-simplification.ipynb

Lines changed: 934 additions & 371 deletions
Large diffs are not rendered by default.

resources/examples/doctor-scheduling.ipynb

Lines changed: 705 additions & 318 deletions
Large diffs are not rendered by default.

resources/examples/fantasy-premier-league.ipynb

Lines changed: 1134 additions & 350 deletions
Large diffs are not rendered by default.

resources/examples/job-shop-scheduling.ipynb

Lines changed: 291 additions & 190 deletions
Large diffs are not rendered by default.

resources/examples/lot-sizing.ipynb

Lines changed: 433 additions & 219 deletions
Large diffs are not rendered by default.

resources/examples/portfolio-optimization.ipynb

Lines changed: 602 additions & 221 deletions
Large diffs are not rendered by default.

resources/examples/product-allocation.ipynb

Lines changed: 585 additions & 277 deletions
Large diffs are not rendered by default.

resources/examples/sudoku.ipynb

Lines changed: 904 additions & 383 deletions
Large diffs are not rendered by default.

resources/guides/managing-modeling-complexity.ipynb

Lines changed: 376 additions & 252 deletions
Large diffs are not rendered by default.

resources/guides/uploading-a-model.ipynb

Lines changed: 262 additions & 258 deletions
Large diffs are not rendered by default.
Lines changed: 100 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,102 @@
11
{
2-
"cells": [
3-
{
4-
"cell_type": "markdown",
5-
"id": "ae17559e",
6-
"metadata": {},
7-
"source": [
8-
"# Using a self-hosted API server\n",
9-
"\n",
10-
"In this notebook we go over the steps required to set up and connect to a self-hosted [API server](https://hub.docker.com/r/opvious/api-server), allowing you to host your own Opvious platform.\n",
11-
"\n",
12-
"<div class=\"alert alert-block alert-warning\">\n",
13-
" &#9888; The API server's image is subject to the <a href=\"https://www.opvious.io/end-user-license-agreements/api-image\">Opvious API image EULA</a>. Commercial use requires a separate license which can be requested <a href=\"https://forms.gle/8ZP2zr91TY9TPcp66\">here</a>.\n",
14-
"</div>\n",
15-
"\n",
16-
"\n",
17-
"## Starting the server\n",
18-
"\n",
19-
"### With the CLI\n",
20-
"\n",
21-
"The simplest way to download and run the API server is with the [Opvious CLI](https://www.npmjs.com/package/opvious-cli#starting-an-api-server). The CLI will take care of setting up the server's dependencies automatically before starting it:\n",
22-
"\n",
23-
"```sh\n",
24-
"npm install -g opvious-cli # Install the CLI\n",
25-
"opvious api start # Start the API server along with its dependencies\n",
26-
"```\n",
27-
"\n",
28-
"Refer to the CLI's README or run `opvious api --help` to view the list of available commands. You may also be interested in the server's telemetry configuration options described [here](https://hub.docker.com/r/opvious/api-server).\n",
29-
"\n",
30-
"\n",
31-
"### From the Docker image\n",
32-
"\n",
33-
"Alternatively, you can download and run the [`opvious/api-server`](https://hub.docker.com/r/opvious/api-server) Docker image directly. This allows you to use it with your own database and/or cache:\n",
34-
"\n",
35-
"```\n",
36-
"docker run -p 8080:8080 \\\n",
37-
" -e DB_URL=postgres:// \\\n",
38-
" -e REDIS_URL=redis:// \\\n",
39-
" -e OPVIOUS_API_IMAGE_EULA \\\n",
40-
" opvious/api-server\n",
41-
"```\n",
42-
"\n",
43-
"Refer to the image's documentation for more information.\n",
44-
"\n",
45-
"\n",
46-
"## Connecting to the server\n",
47-
"\n",
48-
"Once the API server is running, the next step is to use it from the SDKs. To do so, simply set the `OPVIOUS_ENDPOINT` environment variable to the server's endpoint (http://localhost:8080 if started via the CLI with default options). For example from your Bash configuration:\n",
49-
"\n",
50-
"```\n",
51-
"# ~/.bashrc\n",
52-
"OPVIOUS_ENDPOINT=http://localhost:8080\n",
53-
"```\n",
54-
"\n",
55-
"You may also find it useful to create a [dedicated configuration profile](https://www.npmjs.com/package/opvious-cli#configuration-profiles) pointing to it:\n",
56-
"\n",
57-
"```\n",
58-
"# ~/.config/opvious/cli.yml\n",
59-
"profiles:\n",
60-
" - name: local\n",
61-
" endpoint: http://localhost:8080\n",
62-
"```\n",
63-
"\n",
64-
"\n",
65-
"## Authenticating requests\n",
66-
"\n",
67-
"The server's `STATIC_TOKENS` environment variable is used to specify a comma-separated list of static API tokens for authenticating API requests. Each entry's format is `<email>=<token>`, where `<email>` is the associated account's email. When using the CLI, this variable is set with the `-t` option:\n",
68-
"\n",
69-
"```sh\n",
70-
"opvious api start -t user@example.com=secret-token\n",
71-
"```\n",
72-
"\n",
73-
"These tokens can then be used as regular API tokens in SDKs by prefixing them with `static:`. For example requests to the server started with the command just above can be authenticated as `user@example.com` by setting `OPVIOUS_TOKEN=static:secret-token`."
74-
]
75-
},
76-
{
77-
"cell_type": "code",
78-
"execution_count": 1,
79-
"id": "75b0bdbb",
80-
"metadata": {},
81-
"outputs": [],
82-
"source": []
83-
}
84-
],
85-
"metadata": {
86-
"kernelspec": {
87-
"display_name": "Python 3 (ipykernel)",
88-
"language": "python",
89-
"name": "python3"
90-
},
91-
"language_info": {
92-
"codemirror_mode": {
93-
"name": "ipython",
94-
"version": 3
95-
},
96-
"file_extension": ".py",
97-
"mimetype": "text/x-python",
98-
"name": "python",
99-
"nbconvert_exporter": "python",
100-
"pygments_lexer": "ipython3",
101-
"version": "3.11.5"
102-
}
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "ae17559e",
6+
"metadata": {},
7+
"source": [
8+
"# Using a self-hosted API server\n",
9+
"\n",
10+
"In this notebook we go over the steps required to set up and connect to a self-hosted [API server](https://hub.docker.com/r/opvious/api-server), allowing you to host your own Opvious platform.\n",
11+
"\n",
12+
"\n",
13+
"## Starting the server\n",
14+
"\n",
15+
"### With the CLI\n",
16+
"\n",
17+
"The simplest way to download and run the API server is with the [Opvious CLI](https://www.npmjs.com/package/opvious-cli#starting-an-api-server). The CLI will take care of setting up the server's dependencies automatically before starting it:\n",
18+
"\n",
19+
"```sh\n",
20+
"npm install -g opvious-cli # Install the CLI\n",
21+
"opvious api start # Start the API server along with its dependencies\n",
22+
"```\n",
23+
"\n",
24+
"Refer to the CLI's README or run `opvious api --help` to view the list of available commands. You may also be interested in the server's telemetry configuration options described [here](https://hub.docker.com/r/opvious/api-server).\n",
25+
"\n",
26+
"\n",
27+
"### From the Docker image\n",
28+
"\n",
29+
"Alternatively, you can download and run the [`opvious/api-server`](https://hub.docker.com/r/opvious/api-server) Docker image directly. This allows you to use it with your own database and/or cache:\n",
30+
"\n",
31+
"```\n",
32+
"docker run -p 8080:8080 \\\n",
33+
" -e DB_URL=postgres:// \\\n",
34+
" -e REDIS_URL=redis:// \\\n",
35+
" -e OPVIOUS_API_IMAGE_EULA \\\n",
36+
" opvious/api-server\n",
37+
"```\n",
38+
"\n",
39+
"Refer to the image's documentation for more information.\n",
40+
"\n",
41+
"\n",
42+
"## Connecting to the server\n",
43+
"\n",
44+
"Once the API server is running, the next step is to use it from the SDKs. To do so, simply set the `OPVIOUS_ENDPOINT` environment variable to the server's endpoint (http://localhost:8080 if started via the CLI with default options). For example from your Bash configuration:\n",
45+
"\n",
46+
"```\n",
47+
"# ~/.bashrc\n",
48+
"OPVIOUS_ENDPOINT=http://localhost:8080\n",
49+
"```\n",
50+
"\n",
51+
"You may also find it useful to create a [dedicated configuration profile](https://www.npmjs.com/package/opvious-cli#configuration-profiles) pointing to it:\n",
52+
"\n",
53+
"```\n",
54+
"# ~/.config/opvious/cli.yml\n",
55+
"profiles:\n",
56+
" - name: local\n",
57+
" endpoint: http://localhost:8080\n",
58+
"```\n",
59+
"\n",
60+
"\n",
61+
"## Authenticating requests\n",
62+
"\n",
63+
"The server's `STATIC_TOKENS` environment variable is used to specify a comma-separated list of static API tokens for authenticating API requests. Each entry's format is `<email>=<token>`, where `<email>` is the associated account's email. When using the CLI, this variable is set with the `-t` option:\n",
64+
"\n",
65+
"```sh\n",
66+
"opvious api start -t user@example.com=secret-token\n",
67+
"```\n",
68+
"\n",
69+
"These tokens can then be used as regular API tokens in SDKs by prefixing them with `static:`. For example requests to the server started with the command just above can be authenticated as `user@example.com` by setting `OPVIOUS_TOKEN=static:secret-token`."
70+
]
10371
},
104-
"nbformat": 4,
105-
"nbformat_minor": 5
106-
}
72+
{
73+
"cell_type": "code",
74+
"execution_count": 1,
75+
"id": "75b0bdbb",
76+
"metadata": {},
77+
"outputs": [],
78+
"source": []
79+
}
80+
],
81+
"metadata": {
82+
"kernelspec": {
83+
"display_name": "Python 3 (ipykernel)",
84+
"language": "python",
85+
"name": "python3"
86+
},
87+
"language_info": {
88+
"codemirror_mode": {
89+
"name": "ipython",
90+
"version": 3
91+
},
92+
"file_extension": ".py",
93+
"mimetype": "text/x-python",
94+
"name": "python",
95+
"nbconvert_exporter": "python",
96+
"pygments_lexer": "ipython3",
97+
"version": "3.12.5"
98+
}
99+
},
100+
"nbformat": 4,
101+
"nbformat_minor": 5
102+
}

0 commit comments

Comments
 (0)