Skip to content

Commit

Permalink
feat: playground: make stop;
Browse files Browse the repository at this point in the history
  • Loading branch information
guesant committed Mar 27, 2024
1 parent 6cc9192 commit d832e42
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 42 deletions.
3 changes: 3 additions & 0 deletions playground/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
start:
docker compose up lab -d;

stop:
docker compose down -v;

logs:
docker compose logs lab -f;

Expand Down
20 changes: 20 additions & 0 deletions playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,36 @@ cd gerar-horario/playground;

### Scripts do projeto

Para iniciar o servidor jupyter:

```sh
make start; # inicia o container com notebook jupyter usando o docker compose
```

Aplicação Jupyter: <http://127.0.0.1:8888/tree>.

---

Para parar o servidor jupyter:

```sh
make stop; # para e remove o container da aplicação jupyter
```

---

Para ver os logs da aplicação jupyter:

```sh
make logs; # logs do container usando o docker compose
```

---

Caso queria iniciar um shell dentro do container:

```sh
make shell; # abre o bash dentro do container
```

---
55 changes: 13 additions & 42 deletions playground/notebooks/OlaGerador.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"text/html": [
"\r\n",
"<div>\r\n",
" <div id='dotnet-interactive-this-cell-1961.Microsoft.DotNet.Interactive.Http.HttpPort' style='display: none'>\r\n",
" <div id='dotnet-interactive-this-cell-697.Microsoft.DotNet.Interactive.Http.HttpPort' style='display: none'>\r\n",
" The below script needs to be able to find the current output cell; this is an easy method to get it.\r\n",
" </div>\r\n",
" <script type='text/javascript'>\r\n",
Expand Down Expand Up @@ -66,12 +66,12 @@
"}\r\n",
"\r\n",
"function loadDotnetInteractiveApi() {\r\n",
" probeAddresses([\"http://172.18.0.2:2048/\", \"http://127.0.0.1:2048/\"])\r\n",
" probeAddresses([\"http://172.19.0.2:2048/\", \"http://127.0.0.1:2048/\"])\r\n",
" .then((root) => {\r\n",
" // use probing to find host url and api resources\r\n",
" // load interactive helpers and language services\r\n",
" let dotnetInteractiveRequire = require.config({\r\n",
" context: '1961.Microsoft.DotNet.Interactive.Http.HttpPort',\r\n",
" context: '697.Microsoft.DotNet.Interactive.Http.HttpPort',\r\n",
" paths:\r\n",
" {\r\n",
" 'dotnet-interactive': `${root}resources`\r\n",
Expand Down Expand Up @@ -139,14 +139,13 @@
" Determining projects to restore...\n",
" All projects are up-to-date for restore.\n",
" GerarHorario -> /home/user/gerar-horario/projeto-gerar-horario/GerarHorario/bin/Debug/net8.0/GerarHorario.dll\n",
" GerarHorario-Playground -> /home/user/gerar-horario/projeto-gerar-horario/GerarHorario-Playground/bin/Debug/net8.0/GerarHorario-Playground.dll\n",
" GerarHorario-Tests -> /home/user/gerar-horario/projeto-gerar-horario/GerarHorario-Tests/bin/Debug/net8.0/GerarHorario-Tests.dll\n",
"\n",
"Build succeeded.\n",
" 0 Warning(s)\n",
" 0 Error(s)\n",
"\n",
"Time Elapsed 00:00:01.84\n"
"Time Elapsed 00:00:01.67\n"
]
}
],
Expand All @@ -168,37 +167,25 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "6bc79f11-5d85-4350-afc4-02263594c016",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Google.OrTools, 9.8.3296</span></li></ul></div></div>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"#r \"nuget: Google.OrTools,9.8.3296\""
]
},
{
"cell_type": "markdown",
"id": "3d315942-e4bd-420e-9a66-48c547d3ecbf",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"## Importa a lib GerarHorario;"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "eb2599d7-7693-4ad7-8b7c-b3f8e49e23c5",
"metadata": {},
"outputs": [],
Expand All @@ -216,7 +203,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "b375596e-7023-4eb6-bf8b-dbace732afa8",
"metadata": {},
"outputs": [],
Expand All @@ -234,18 +221,10 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "0fee0429-ba2b-455a-966f-71b00ec3cb1e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Olá, Mundo!\n"
]
}
],
"outputs": [],
"source": [
"Console.WriteLine(\"Olá, Mundo!\");"
]
Expand All @@ -260,18 +239,10 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "a8c24654-2664-4cc0-8c0d-3cb22b94c5b8",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"True\n"
]
}
],
"outputs": [],
"source": [
"Console.WriteLine((new Main()).Retorno());"
]
Expand Down

0 comments on commit d832e42

Please sign in to comment.