Skip to content

Commit

Permalink
Jupyter Notebook (#116)
Browse files Browse the repository at this point in the history
* The initial structure of Jupyter notebook scripts.

* Update aws config.fab

* Updated native gcp config.fab

* Update native-gcp.ipynb

* Update fabfed-demo.ipynb

* Update native-aws.ipynb

* Create sense-gcp config.fab

* Create sense-gcp.ipynb

* Update fabfed-demo.ipynb

* Create sense-aws.ipynb

* Update fabfed-demo.ipynb

* Create config.fab

* Create fablib-tools.ipynb

* Create chameleon.ipynb

* Create cloudlab.ipynb

* Config.fab for chameleon

* Create config.fab

* Create config.fab

* Create config.fab

* Create config.fab

* Create config.fab

* Create fablib-tools.ipynb

* Create native-aws.ipynb

* Create native-gcp.ipynb

* Create sense-aws.ipynb

* Create sense-gcp.ipynb

* Create welcom.ipynb

* Change directory name from notebooks to jupyter

* Update fablib-tools.ipynb

* Update welcom.ipynb

* Update sense-gcp.ipynb

* Update native-gcp.ipynb

* Create fabfed_credentials_template.yml
  • Loading branch information
zlion authored Mar 11, 2024
1 parent 6963af3 commit 9acae34
Show file tree
Hide file tree
Showing 16 changed files with 1,978 additions and 0 deletions.
169 changes: 169 additions & 0 deletions jupyter/chameleon.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "4ed9aa05-01b2-4a98-9992-acd8f38615e2",
"metadata": {},
"source": [
"# Chameleon + Fabric\n",
"Stitching Chameleon and Fabric resources."
]
},
{
"cell_type": "markdown",
"id": "cfe860e3-340c-4d54-8ce7-c883e00486a1",
"metadata": {},
"source": [
"## Assign session name and .fab path"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d8efd310-300a-4f56-bb26-5431bdec3969",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"\n",
"session_name = \"chameleon-lzhang9\"\n",
"#fab_file_path = os.path.dirname(os.getcwd()) + \"/examples/aws\"\n",
"fab_file_path = \"./examples/chameleon/star\"\n",
"\n",
"print(session_name)\n",
"print(fab_file_path)"
]
},
{
"cell_type": "markdown",
"id": "1d63bdfb-177e-4dd0-bdfb-091c0f84f476",
"metadata": {},
"source": [
"## Validate .fab files"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "72148135-c66f-41ed-9a36-b037c7fbb966",
"metadata": {},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -validate"
]
},
{
"cell_type": "markdown",
"id": "2df23e14-492c-44be-9cc8-e4e041f0bead",
"metadata": {},
"source": [
"## Add resources to providers and validate resources"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0aa67fe6-34b4-4a20-b9b3-a5fb6921efd2",
"metadata": {},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -plan"
]
},
{
"cell_type": "markdown",
"id": "c29bf401-66d9-4b8b-9c68-fd2ebbd85ee2",
"metadata": {},
"source": [
"## View stitching information"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9d3324c9-004e-4c29-b768-08b2de294ed3",
"metadata": {},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -init -summary"
]
},
{
"cell_type": "markdown",
"id": "d19fef3d-2d37-4ffc-8f8f-07446bc5a484",
"metadata": {},
"source": [
"## Create resources"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e5e16ead-338b-4e3c-9e38-61203a2489f4",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -apply"
]
},
{
"cell_type": "markdown",
"id": "f5a08986-10f1-478d-9460-c0c5c67f23d1",
"metadata": {},
"source": [
"## View the state of the workflow"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1dfdcf82-03c0-42a7-8fd0-78a04ed1e0fe",
"metadata": {},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -show"
]
},
{
"cell_type": "markdown",
"id": "ab33e762-ad89-49ce-9b09-ceb79797ec78",
"metadata": {},
"source": [
"## Delete all resources"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "57305ac9-fa7e-4578-a200-ecdcb74a2a4c",
"metadata": {},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -destroy"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
169 changes: 169 additions & 0 deletions jupyter/cloudlab.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "4ed9aa05-01b2-4a98-9992-acd8f38615e2",
"metadata": {},
"source": [
"# Cloudlab + Fabric\n",
"Stitching Cloudlab and Fabric resources."
]
},
{
"cell_type": "markdown",
"id": "cfe860e3-340c-4d54-8ce7-c883e00486a1",
"metadata": {},
"source": [
"## Assign session name and .fab path"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d8efd310-300a-4f56-bb26-5431bdec3969",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"\n",
"session_name = \"cloudlab-lzhang9\"\n",
"#fab_file_path = os.path.dirname(os.getcwd()) + \"/examples/aws\"\n",
"fab_file_path = \"./examples/cloudlab\"\n",
"\n",
"print(session_name)\n",
"print(fab_file_path)"
]
},
{
"cell_type": "markdown",
"id": "1d63bdfb-177e-4dd0-bdfb-091c0f84f476",
"metadata": {},
"source": [
"## Validate .fab files"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "72148135-c66f-41ed-9a36-b037c7fbb966",
"metadata": {},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -validate"
]
},
{
"cell_type": "markdown",
"id": "2df23e14-492c-44be-9cc8-e4e041f0bead",
"metadata": {},
"source": [
"## Add resources to providers and validate resources"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0aa67fe6-34b4-4a20-b9b3-a5fb6921efd2",
"metadata": {},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -plan"
]
},
{
"cell_type": "markdown",
"id": "c29bf401-66d9-4b8b-9c68-fd2ebbd85ee2",
"metadata": {},
"source": [
"## View stitching information"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9d3324c9-004e-4c29-b768-08b2de294ed3",
"metadata": {},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -init -summary"
]
},
{
"cell_type": "markdown",
"id": "d19fef3d-2d37-4ffc-8f8f-07446bc5a484",
"metadata": {},
"source": [
"## Create resources"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e5e16ead-338b-4e3c-9e38-61203a2489f4",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -apply"
]
},
{
"cell_type": "markdown",
"id": "f5a08986-10f1-478d-9460-c0c5c67f23d1",
"metadata": {},
"source": [
"## View the state of the workflow"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1dfdcf82-03c0-42a7-8fd0-78a04ed1e0fe",
"metadata": {},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -show"
]
},
{
"cell_type": "markdown",
"id": "ab33e762-ad89-49ce-9b09-ceb79797ec78",
"metadata": {},
"source": [
"## Delete all resources"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "57305ac9-fa7e-4578-a200-ecdcb74a2a4c",
"metadata": {},
"outputs": [],
"source": [
"!fabfed workflow -s $session_name -c $fab_file_path -destroy"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
55 changes: 55 additions & 0 deletions jupyter/examples/chameleon/star/config.fab
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
provider:
- fabric:
- fabric_provider:
credential_file: ~/.fabfed/fabfed_credentials.yml
profile: fabric
- chi:
- chi_provider:
credential_file: ~/.fabfed/fabfed_credentials.yml
profile: chi
- janus:
- janus_provider:
credential_file: ~/.fabfed/fabfed_credentials.yml
profile: janus

config:
- layer3:
- my_layer:
subnet: 192.168.100.0/24
gateway: 192.168.100.1
ip_start: 192.168.100.100
ip_end: 192.168.100.250
resource:
- network:
- chi_network:
provider: '{{ chi.chi_provider }}'
name: stitch_net
layer3: "{{ layer3.my_layer }}"
count: 1
- fabric_network:
provider: '{{ fabric.fabric_provider }}'
interface: '{{ node.fabric_node }}'
layer3: "{{ layer3.my_layer }}"
count: 1
stitch_with: '{{ network.chi_network }}'
stitch_option:
site: STAR
- node:
- fabric_node:
provider: '{{ fabric.fabric_provider }}'
count: 1
image: default_rocky_8
- chi_node:
provider: '{{ chi.chi_provider }}'
image: CC-Ubuntu20.04
network: '{{ network.chi_network }}'
count: 1
flavor: m1.medium
- service:
- dtn_service:
provider: '{{ janus.janus_provider }}'
node: [ '{{ node.chi_node }}', '{{ node.fabric_node }}' ]
controller: '{{ node.fabric_node }}'
image: dtnaas/tools
profile: fabfed
count: 1
Loading

0 comments on commit 9acae34

Please sign in to comment.