Skip to content

Commit

Permalink
chore(notebook): adjust the layout
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Dec 29, 2023
1 parent b03c342 commit 89aa402
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Render Quarto
run: |
nix develop ./nix/std -c just quarto example
nix develop ./nix/std -c just quarto example render
- name: Deploy Github-Page
uses: JamesIves/[email protected]
Expand Down
16 changes: 12 additions & 4 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@

jupyterlab job Flag:
std //repo/jupyenv/{{job}}:{{Flag}} -- "$@"
jupyterlab job flag:
std //repo/jupyenv/{{job}}:{{flag}} -- "$@"

quarto+example: d2-example
std //repo/jupyenv/example:quarto -- render ./notebook
jupyterlab-run:
#!/usr/bin/env bash
if [[ -f "$PRJ_ROOT/.env" ]]; then
source "$PRJ_ROOT/.env"; std //repo/jupyenv/example:run -- --ip 0.0.0.0 --port 8888
else
std //repo/jupyenv/example:run -- --ip 0.0.0.0 --port 8888
fi
quarto job flag: d2-example
std //repo/jupyenv/{{job}}:quarto -- {{flag}} ./notebook

d2-example:
(d2 fmt ./notebook/flow.d2 && d2 ./notebook/flow.d2)
10 changes: 6 additions & 4 deletions notebook/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ book:
chapters:
- index.qmd

- julia.qmd
- part: julia-test.ipynb
- part: julia.qmd
chapters:
- julia-test.ipynb

- python.qmd
- part: python-test.ipynb
- part: python.qmd
chapters:
- python-test.ipynb

# sidebar:
# tools:
Expand Down
16 changes: 15 additions & 1 deletion notebook/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ title: Overview
date: 2023-12-27
---

# Getting Stared

```bash
git clone https://github.com/hardenedlinux/AISecurity-Research-Template
cd AISecurity-Research-Template

docker pull ghcr.io/hardenedlinux/aisecurity-research-template
docker run --platform linux/amd64 -it -v "$(pwd):/work" --entrypoint bash ghcr.io/hardenedlinux/aisecurity-research-template:latest

podman run --platform linux/amd64 -it -v "$(pwd):/work" --userns=keep-id --entrypoint bash ghcr.io/hardenedlinux/aisecurity-research-template-users:latest
```
- Actions:
+ jupyterlab: just jupyterlab-run
+ quarto: just quarto example <render/preview>

# Workflow

```{python kernel="python-data-science"}
Expand All @@ -16,7 +31,6 @@ SVG(filename='flow.svg')
```



# Acknowledgments

- [Guidelines for secure AI system development
Expand Down
79 changes: 50 additions & 29 deletions notebook/julia-test.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions notebook/julia.qmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Julia

- https://julialang.org/
- https://cn.julialang.org/
8 changes: 8 additions & 0 deletions notebook/python-test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
"---"
]
},
{
"cell_type": "markdown",
"id": "c8a43730-49e7-45ea-996f-c0359e32eba3",
"metadata": {},
"source": [
"## openAPI Python binding"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down

0 comments on commit 89aa402

Please sign in to comment.