From 4005f56160b47dd5fadfc9ce6fc48ef5a96a7877 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Mon, 11 Mar 2024 00:07:23 -0500 Subject: [PATCH] Change directory name from notebooks to jupyter --- notebooks/examples/README.md | 0 notebooks/examples/native-aws/README.md | 0 notebooks/examples/native-aws/config.fab | 57 ---- notebooks/examples/native-gcp/README.md | 0 notebooks/examples/native-gcp/config.fab | 56 ---- notebooks/examples/sense-aws/config.fab | 63 ---- notebooks/examples/sense-gcp/config.fab | 78 ----- notebooks/fabfed-demo.ipynb | 130 -------- .../fabfed_credentials_template.yml | 62 ---- notebooks/fablib-tools.ipynb | 308 ------------------ notebooks/native-aws.ipynb | 180 ---------- notebooks/native-gcp.ipynb | 175 ---------- notebooks/sense-aws.ipynb | 180 ---------- notebooks/sense-gcp.ipynb | 178 ---------- 14 files changed, 1467 deletions(-) delete mode 100644 notebooks/examples/README.md delete mode 100644 notebooks/examples/native-aws/README.md delete mode 100644 notebooks/examples/native-aws/config.fab delete mode 100644 notebooks/examples/native-gcp/README.md delete mode 100644 notebooks/examples/native-gcp/config.fab delete mode 100644 notebooks/examples/sense-aws/config.fab delete mode 100644 notebooks/examples/sense-gcp/config.fab delete mode 100644 notebooks/fabfed-demo.ipynb delete mode 100644 notebooks/fabfed_config/fabfed_credentials_template.yml delete mode 100644 notebooks/fablib-tools.ipynb delete mode 100644 notebooks/native-aws.ipynb delete mode 100644 notebooks/native-gcp.ipynb delete mode 100644 notebooks/sense-aws.ipynb delete mode 100644 notebooks/sense-gcp.ipynb diff --git a/notebooks/examples/README.md b/notebooks/examples/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/notebooks/examples/native-aws/README.md b/notebooks/examples/native-aws/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/notebooks/examples/native-aws/config.fab b/notebooks/examples/native-aws/config.fab deleted file mode 100644 index 7ec7245d..00000000 --- a/notebooks/examples/native-aws/config.fab +++ /dev/null @@ -1,57 +0,0 @@ -variable: - - vpc: - default: vpc-0936b973cf039f794 -provider: - - aws: - - aws_provider: - credential_file: ~/.fabfed/fabfed_credentials.yml - profile: aws - - fabric: - - fabric_provider: - credential_file: ~/.fabfed/fabfed_credentials.yml - profile: fabric -config: - - layer3: - - fab_layer: - subnet: 192.168.10.0/24 - gateway: 192.168.10.1 - ip_start: 192.168.10.2 - ip_end: 192.168.10.254 - - aws_layer: - subnet: 10.0.1.0/24 - - peering: - - my_peering: - # FOR FABRIC - cloud_account: "296256999979" - # FOR AWS and FABRIC - cloud_region: "us-east-1" - cloud_vpc: '{{ var.vpc }}' - remote_asn: 64512 # amazon_asn - local_asn: 55038 # customer_asn - # FOR FABRIC - local_address: "192.168.1.1/30" # customer_ip - remote_address: "192.168.1.2/30" # amazon_ip -resource: - - network: - - aws_net: - provider: '{{ aws.aws_provider }}' - name: aws-net - layer3: "{{ layer3.aws_layer }}" - peering: "{{ peering.my_peering }}" - stitch_with: '{{ network.fabric_network }}' - stitch_option: - device_name: agg3.ashb - count: 1 - - fabric_network: - provider: '{{ fabric.fabric_provider }}' - layer3: "{{ layer3.fab_layer }}" - peering: "{{ peering.my_peering }}" - interface: '{{ node.fabric_node }}' - count: 1 - - node: - - fabric_node: - provider: '{{ fabric.fabric_provider }}' - site: MAX # Use RENC when deploying to fabric beta environment - image: default_rocky_8 - count: 1 - nic_model: NIC_Basic diff --git a/notebooks/examples/native-gcp/README.md b/notebooks/examples/native-gcp/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/notebooks/examples/native-gcp/config.fab b/notebooks/examples/native-gcp/config.fab deleted file mode 100644 index 03c1192d..00000000 --- a/notebooks/examples/native-gcp/config.fab +++ /dev/null @@ -1,56 +0,0 @@ -variable: - - vpc: - default: vpc-69acc1d9-8c24-47cd-90b8-33be57167dbf -provider: - - gcp: - - gcp_provider: - credential_file: ~/.fabfed/fabfed_credentials.yml - profile: gcp - - fabric: - - fabric_provider: - credential_file: ~/.fabfed/fabfed_credentials.yml - profile: fabric -config: - - layer3: - - fab_layer: - subnet: 192.168.10.0/24 - gateway: 192.168.10.1 - ip_start: 192.168.10.2 - ip_end: 192.168.10.254 - - gcp_layer: - subnet: 10.100.0.0/24 # subnet.cidr and vpc.cidr - - peering: - - my_peering: - # FOR GCP - cloud_region: "us-east4" - cloud_vpc: '{{ var.vpc }}' - # uncomment and override cloud_vlan with a value between 3 and 4095. The default is 4. - # cloud_vlan: - - # FOR GCP AND FABRIC. - remote_asn: 16550 # google_asn - # FOR FABRIC - local_address: "192.168.1.1/30" # customer_ip - remote_address: "192.168.1.2/30" # google_ip -resource: - - network: - - gcp_net: - provider: '{{ gcp.gcp_provider }}' - name: gcp-net - layer3: "{{ layer3.gcp_layer }}" - peering: "{{ peering.my_peering }}" - stitch_with: '{{ network.fabric_network }}' - count: 1 - - fabric_network: - provider: '{{ fabric.fabric_provider }}' - layer3: "{{ layer3.fab_layer }}" - peering: "{{ peering.my_peering }}" - interface: '{{ node.fabric_node }}' - count: 1 - - node: - - fabric_node: - provider: '{{ fabric.fabric_provider }}' - site: MAX - image: default_rocky_8 - count: 1 - nic_model: NIC_Basic diff --git a/notebooks/examples/sense-aws/config.fab b/notebooks/examples/sense-aws/config.fab deleted file mode 100644 index a6333942..00000000 --- a/notebooks/examples/sense-aws/config.fab +++ /dev/null @@ -1,63 +0,0 @@ -provider: - - sense: - - sense_provider: - - credential_file: ~/.fabfed/fabfed_credentials.yml - profile: sense - - fabric: - - fabric_provider: - credential_file: ~/.fabfed/fabfed_credentials.yml - profile: fabric -config: - - layer3: - - fab_layer: - subnet: 192.168.10.0/24 # subnet: "10.0.0.0/24" # for sense subnet.cidr - gateway: 192.168.10.1 - ip_start: 192.168.10.2 # optional: auto generate if subnet is given - ip_end: 192.168.10.254 - - sense_layer: - subnet: 10.200.1.0/24 # subnet.cidr and vpc.cidr - - peering: - - my_peering: - # FOR FABRIC - cloud_account: "296256999979" - cloud_facility: - local_device: - local_port: - cloud_region: "us-east-1" - - # FOR SENSE and FABRIC - local_asn: "55038" # customer_asn (hard coded for now) - local_address: "192.168.1.1/30" # customer_ip - remote_asn: "64512" # amazon_asn - remote_address: "192.168.1.2/30" # amazon_ip -resource: - - node: - - sense_node: - provider: '{{ sense.sense_provider }}' - name: aws-node - network: "{{ network.sense_net }}" - service: - count: 1 - - fabric_node: - provider: '{{ fabric.fabric_provider }}' - site: MAX # Use RENC when deploying to fabric beta environment - image: default_rocky_8 - count: 1 - nic_model: NIC_Basic - - network: - - sense_net: - provider: '{{ sense.sense_provider }}' - name: aws-net - layer3: "{{ layer3.sense_layer }}" - peering: "{{ peering.my_peering }}" - count: 1 - stitch_with: '{{ network.fabric_network }}' - stitch_option: - device_name: agg3.ashb - - - fabric_network: - provider: '{{ fabric.fabric_provider }}' - layer3: "{{ layer3.fab_layer }}" - peering: "{{ peering.my_peering }}" - interface: '{{ node.fabric_node }}' - count: 1 diff --git a/notebooks/examples/sense-gcp/config.fab b/notebooks/examples/sense-gcp/config.fab deleted file mode 100644 index 6ae27417..00000000 --- a/notebooks/examples/sense-gcp/config.fab +++ /dev/null @@ -1,78 +0,0 @@ -provider: - - sense: - - sense_provider: - - credential_file: ~/.fabfed/fabfed_credentials.yml - profile: sense - - fabric: - - fabric_provider: - credential_file: ~/.fabfed/fabfed_credentials.yml - profile: fabric - - janus: - - janus_provider: - credential_file: ~/.fabfed/fabfed_credentials.yml - profile: janus -config: - - layer3: - - fab_layer: - subnet: 192.168.10.0/24 # subnet: "10.0.0.0/24" # for sense subnet.cidr - gateway: 192.168.10.1 - ip_start: 192.168.10.2 # optional: auto generate if subnet is given - ip_end: 192.168.10.254 - - sense_layer: - subnet: 10.200.1.0/24 # subnet.cidr and vpc.cidr - - peering: - - my_peering: - # FOR FABRIC - # cloud_account: "296256999979" # pairing key - # cloud_facility: - # local_device: "agg3.ashb.net.internet2.edu" - # local_port: "Bundle-Ether5" - # cloud_region: "us-east4" - # cloud_vlan: - - # FOR SENSE and FABRIC - local_asn: "55038" # customer_asn (hard coded for now) - local_address: "192.168.1.1/30" # customer_ip (ignore) - remote_asn: "16550" # google_asn (default) - remote_address: "192.168.1.2/30" # google_ip (ignore) -resource: - - node: - - sense_node: - provider: '{{ sense.sense_provider }}' - name: gcp-node - network: "{{ network.sense_net }}" - service: - count: 1 - - fabric_node: - provider: '{{ fabric.fabric_provider }}' - site: MAX - image: default_rocky_8 - count: 1 - nic_model: NIC_Basic - - network: - - sense_net: - provider: '{{ sense.sense_provider }}' - name: gcp-net - layer3: "{{ layer3.sense_layer }}" - peering: "{{ peering.my_peering }}" - count: 1 - profile: FABRIC-GCP-INTERCON - stitch_with: '{{ network.fabric_network }}' - profile: FABRIC-GCP-INTERCON - stitch_option: - group_name: GCP - - - fabric_network: - provider: '{{ fabric.fabric_provider }}' - layer3: "{{ layer3.fab_layer }}" - peering: "{{ peering.my_peering }}" - interface: '{{ node.fabric_node }}' - count: 1 - - service: - - dtn_service: - provider: '{{ janus.janus_provider }}' - node: [ '{{ node.sense_node }}', '{{ node.fabric_node }}' ] - controller: '{{ node.fabric_node }}' - image: dtnaas/tools - profile: fabfed - count: 0 # SET THIS TO 1 if you want use janus service diff --git a/notebooks/fabfed-demo.ipynb b/notebooks/fabfed-demo.ipynb deleted file mode 100644 index 7974ce95..00000000 --- a/notebooks/fabfed-demo.ipynb +++ /dev/null @@ -1,130 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "f03b798d-387a-49e7-bc74-8306b8b3cbfc", - "metadata": {}, - "source": [ - "# FabFed Demo\n", - "The following script outlines the steps involved in utilizing the FABFED toolkit." - ] - }, - { - "cell_type": "markdown", - "id": "5922d7e6-6074-4847-ad98-7c2947212a94", - "metadata": {}, - "source": [ - "## Installation\n", - "If the FabFed package is not present, install it." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6f7d9a55-9eaf-45e4-b950-c73f92053f71", - "metadata": {}, - "outputs": [], - "source": [ - "!pip install --upgrade fabfed-py --quiet\n", - "\n", - "!pip show fabfed-py" - ] - }, - { - "cell_type": "markdown", - "id": "c438d0ec-978c-4db6-ab61-f125b72de776", - "metadata": {}, - "source": [ - "## Configuration of Credentials\n", - "The Fabfed credential file is a YAML file that contains account information and keying material for each provider using sections aka profiles. Create the your own credential file in the directory fabfed_config using the template.\n", - "\n", - "### Create the credential file if it does not exist" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "dd5c21d0-d8d7-49e1-bc59-15004613ac20", - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "\n", - "file_path = 'fabfed_config/fabfed_credentials.yml'\n", - "\n", - "if os.path.exists(file_path):\n", - " print(\"The file exists.\")\n", - "else:\n", - " print(\"The file does not exist.\")\n", - " import shutil\n", - " #source_file = 'fabfed_config/fabfed_credentials_template.yml'\n", - " source_file = '/users/lzhang9/.fabfed/fabfed_credentials.yml'\n", - " destination_file = 'fabfed_config/fabfed_credentials.yml'\n", - " shutil.copy(source_file, destination_file)\n", - " print(\"File copied successfully from\", source_file, \"to\", destination_file)" - ] - }, - { - "cell_type": "markdown", - "id": "c57ff496-8ef7-4bea-82d6-5cd22596e467", - "metadata": {}, - "source": [ - "### Add credentials to the file [credential file](./fabfed_config/fabfed_credentials.yml) if needed" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "779c81b2-3260-4222-be63-7084cc386133", - "metadata": {}, - "outputs": [], - "source": [ - "!cat $file_path" - ] - }, - { - "cell_type": "markdown", - "id": "8127923d-a615-4472-981a-fc20d01aca35", - "metadata": {}, - "source": [ - "## Examples\n", - "List of examples for various scenarioes:\n", - "\n", - "- [native aws](./native-aws.ipynb): Stiching native AWS and Fabric\n", - "- [native gcp](./native-gcp.ipynb): Stiching native GCP and Fabric\n", - "- [SENSE aws](./sense-aws.ipynb): Stiching SENSE AWS and Fabric\n", - "- [SENSE gcp](./sense-gcp.ipynb): Stiching SENSE GCP and Fabric" - ] - }, - { - "cell_type": "markdown", - "id": "ed522844-efde-4b84-b65e-4cd263f0efeb", - "metadata": {}, - "source": [ - "## Tools\n", - "- [fablib](./fablib-tools.ipynb): Utilities of fablib to manage Fabric slices." - ] - } - ], - "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 -} diff --git a/notebooks/fabfed_config/fabfed_credentials_template.yml b/notebooks/fabfed_config/fabfed_credentials_template.yml deleted file mode 100644 index 3550eb64..00000000 --- a/notebooks/fabfed_config/fabfed_credentials_template.yml +++ /dev/null @@ -1,62 +0,0 @@ -# Fabric -# https://portal.fabric-testbed.net -# Create and download FABRIC at https://portal.fabric-testbed.net/ via Experiments -> Manage Tokens -# Create a Bastion Key and User FABRIC at https://portal.fabric-testbed.net/ via Experiments -> Manage SSH Keys -fabric: - bastion-user-name: - token-location: - bastion-key-location: - project_id: - slice-private-key-location: - slice-public-key-location: - -# Chameleon -# https://www.chameleoncloud.org/ -# Create a CLI Password as described here: https://chameleoncloud.readthedocs.io/en/latest/technical/cli.html -# Project Name can be found https://www.chameleoncloud.org/ -chi: - project_name: - key_pair: - user: - password: - slice-private-key-location: - slice-public-key-location: - -# https://sense-o.es.net:8443/StackV-web/portal/ -sense: - auth_endpoint: https://sense-o.es.net:8543/auth/realms/StackV/protocol/openid-connect/token - api_endpoint: https://sense-o-dev.es.net:8443/StackV-web/restapi - client_id: StackV - username: - password: - secret: - verify: False - slice-private-key-location: # THIS IS NEEDED IF USING JANUS SERVICE - - -janus: - url: - username: - password: - token: - -# Cloudlab -# https://cloudlab.us -# Create an account and join project fabfed -# Must download certificate and reference it below -cloudlab: - project: - certificate: - user: - slice-private-key-location: - -# Amazon AWS -aws: - access_key: - secret_key: - -# Google Cloud -# Create a service account and downdload it to the path below -gcp: - service_key_path: - project: diff --git a/notebooks/fablib-tools.ipynb b/notebooks/fablib-tools.ipynb deleted file mode 100644 index f5199337..00000000 --- a/notebooks/fablib-tools.ipynb +++ /dev/null @@ -1,308 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "57c387fd-49d1-4d47-ab64-910d94ec0244", - "metadata": {}, - "source": [ - "# FABLIB Tools\n" - ] - }, - { - "cell_type": "markdown", - "id": "1c84b882-9d63-4c45-a8ae-5cb22c1191a2", - "metadata": {}, - "source": [ - "## Import the FABlib Library\n", - "Chose one of two working enviroments to import FABlib.\n", - "- fabric-testbed\n", - "- local host" - ] - }, - { - "cell_type": "markdown", - "id": "04c03230-61f4-48e5-a5bc-031f494e5c2a", - "metadata": {}, - "source": [ - "### Environment: Fabric-Testbed" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "25e4df8b-4eed-4fdf-b6ac-2a801945b251", - "metadata": {}, - "outputs": [], - "source": [ - "from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager\n", - "import json\n", - "\n", - "try:\n", - " fablib = fablib_manager()\n", - " \n", - " fablib.show_config();\n", - "except Exception as e:\n", - " print(f\"Exception: {e}\")" - ] - }, - { - "cell_type": "markdown", - "id": "1df07de8-ac57-41da-966f-8865d4cb42e7", - "metadata": {}, - "source": [ - "### Environment: Local Host" - ] - }, - { - "cell_type": "markdown", - "id": "07c7fbc9-730c-4cb9-a1b4-03afb1ad5fa8", - "metadata": {}, - "source": [ - "Get Fabric configuration from FABFED credential file\n", - "- Set the path to fabfed credential file\n", - "- Read the fabric configuration from fabfed crential file\n", - "- Set the path to ssh_config the same as that of the bastion_ssh_key\n", - "- Generate fabric_rc\n", - "- Import Fablib" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3dde8e65-5de4-4d47-a9cf-08c09d9f9394", - "metadata": {}, - "outputs": [], - "source": [ - "# Path to your YAML file\n", - "credential_file_path = 'fabfed_config/fabfed_credentials.yml'" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "73906428-445a-47d9-850c-859eac86e8d1", - "metadata": {}, - "outputs": [], - "source": [ - "import yaml\n", - "\n", - "# Read the YAML file\n", - "with open(credential_file_path, 'r') as file:\n", - " try:\n", - " yaml_data = yaml.safe_load(file)\n", - " except yaml.YAMLError as exc:\n", - " print(exc)\n", - "\n", - "fabric_config = yaml_data['fabric']\n", - "\n", - "def print_dict(dictionary, indent=0):\n", - " for key, value in dictionary.items():\n", - " if isinstance(value, dict):\n", - " print(' ' * indent + str(key) + ':')\n", - " print_dict(value, indent + 1)\n", - " else:\n", - " print(' ' * indent + str(key) + ': ' + str(value))\n", - " \n", - "print_dict(fabric_config)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5a87ec9b-5c69-4b61-b7e6-c6d78355fbfe", - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "\n", - "home_directory = os.path.expanduser(\"~\")\n", - "print(\"Home directory:\", home_directory)\n", - "\n", - "bastion_ssh_config_file = os.path.dirname(fabric_config['bastion-key-location']) + \"/ssh-config\"\n", - "print(f\"ssh_config path: {bastion_ssh_config_file}\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "60790e7d-245a-416a-bcee-0ed3d5c49306", - "metadata": {}, - "outputs": [], - "source": [ - "# Data to write to the file\n", - "data = f\"\"\"\n", - "export FABRIC_CREDMGR_HOST=cm.fabric-testbed.net\n", - "export FABRIC_ORCHESTRATOR_HOST=orchestrator.fabric-testbed.net\n", - "export FABRIC_PROJECT_ID={fabric_config['project_id']}\n", - "export FABRIC_TOKEN_LOCATION={fabric_config['token-location']}\n", - "\n", - "export FABRIC_BASTION_HOST=bastion.fabric-testbed.net\n", - "export FABRIC_BASTION_USERNAME={fabric_config['bastion-user-name']}\n", - "\n", - "export FABRIC_BASTION_KEY_LOCATION={fabric_config['bastion-key-location']}\n", - "#export FABRIC_BASTION_KEY_PASSPHRASE=\n", - "\n", - "export FABRIC_BASTION_SSH_CONFIG_FILE={bastion_ssh_config_file}\n", - "\n", - "export FABRIC_SLICE_PRIVATE_KEY_FILE={fabric_config['slice-private-key-location']}\n", - "export FABRIC_SLICE_PUBLIC_KEY_FILE={fabric_config['slice-public-key-location']} \n", - "#export FABRIC_SLICE_PRIVATE_KEY_PASSPHRASE=\n", - "\n", - "export FABRIC_LOG_FILE={home_directory}/fablib.log\n", - "export FABRIC_LOG_LEVEL=INFO \n", - "\n", - "export FABRIC_AVOID=''\n", - "\n", - "export FABRIC_SSH_COMMAND_LINE=\"ssh -i {{ _self_.private_ssh_key_file }} -F {bastion_ssh_config_file} {{ _self_.username }}@{{ _self_.management_ip }}\"\n", - "\"\"\"\n", - "\n", - "# Specify the file path\n", - "fabric_rc_file = \"./fabric_config/fabric_rc\"\n", - "\n", - "# Delete if it exists\n", - "if os.path.exists(fabric_rc_file):\n", - " # Delete the file\n", - " os.remove(fabric_rc_file)\n", - " \n", - "# Open the file in write mode\n", - "with open(fabric_rc_file, \"w\") as file:\n", - " # Write the data to the file\n", - " file.write(data)\n", - "\n", - "print(\"Data has been written to\", fabric_rc_file)\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "2714cb84-3915-4272-9e43-f8eac4d06994", - "metadata": {}, - "outputs": [], - "source": [ - "from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager\n", - "import json\n", - "\n", - "try:\n", - " fablib = fablib_manager(fabric_rc=fabric_rc_file)\n", - " \n", - " fablib.show_config();\n", - "except Exception as e:\n", - " print(f\"Exception: {e}\")" - ] - }, - { - "cell_type": "markdown", - "id": "5895ddb9-1a78-4efc-a700-5cdd0a191ca6", - "metadata": {}, - "source": [ - "## Show Slice Information" - ] - }, - { - "cell_type": "markdown", - "id": "cf501be0-3613-4217-81a7-e4b6011c9222", - "metadata": {}, - "source": [ - "### List all slices" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0efa1db9-151f-42b8-be43-411405e667c1", - "metadata": {}, - "outputs": [], - "source": [ - "fablib.list_slices()" - ] - }, - { - "cell_type": "markdown", - "id": "fbf13418-e0e7-414e-9aea-56b81bc7f567", - "metadata": {}, - "source": [ - "### Show specific slice" - ] - }, - { - "cell_type": "markdown", - "id": "d6a6e4a0-f10f-4723-9330-34f1e6724b43", - "metadata": {}, - "source": [ - "Observe the specific slice's attributes" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "cd1dfea3-55cf-4ef6-92ef-c115b8846bed", - "metadata": {}, - "outputs": [], - "source": [ - "slice_name = \"native-aws-lzhang9-1\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a5465749-e292-4de1-a73e-6377adb9e9d9", - "metadata": {}, - "outputs": [], - "source": [ - "try:\n", - " slice = fablib.get_slice(name=slice_name)\n", - " slice.show()\n", - " slice.list_nodes()\n", - " slice.list_networks()\n", - " slice.list_interfaces()\n", - "except Exception as e:\n", - " print(f\"Exception: {e}\")" - ] - }, - { - "cell_type": "markdown", - "id": "60eee875-942d-4653-b80d-4de6e65e19d3", - "metadata": {}, - "source": [ - "## Delete the Slice\n", - "\n", - "Please delete your slice when you are done with your experiment." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "cf9de91d-7045-4b07-ba7d-1c7eae1c0f17", - "metadata": {}, - "outputs": [], - "source": [ - "try:\n", - " slice = fablib.get_slice(name=slice_name)\n", - " slice.delete()\n", - "except Exception as e:\n", - " print(f\"Exception: {e}\")" - ] - } - ], - "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 -} diff --git a/notebooks/native-aws.ipynb b/notebooks/native-aws.ipynb deleted file mode 100644 index 54e01085..00000000 --- a/notebooks/native-aws.ipynb +++ /dev/null @@ -1,180 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "4ed9aa05-01b2-4a98-9992-acd8f38615e2", - "metadata": {}, - "source": [ - "# Native AWS + Fabric\n", - "Stitching native AWS 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 = \"native-aws-lzhang9\"\n", - "#fab_file_path = os.path.dirname(os.getcwd()) + \"/examples/aws\"\n", - "fab_file_path = \"./examples/native-aws\"\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" - ] - }, - { - "cell_type": "markdown", - "id": "138944ac-3892-41e2-a9cc-2c59383b5d63", - "metadata": {}, - "source": [ - "## Note: Amazon Instance Info\n", - "- EC2/Instances/i-078a7be6f4a3df5d6\n", - "- Private IPv4 10.0.1.106\n", - "- Public IPv4 54.242.87.34" - ] - } - ], - "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 -} diff --git a/notebooks/native-gcp.ipynb b/notebooks/native-gcp.ipynb deleted file mode 100644 index e13fc5ed..00000000 --- a/notebooks/native-gcp.ipynb +++ /dev/null @@ -1,175 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "4ed9aa05-01b2-4a98-9992-acd8f38615e2", - "metadata": {}, - "source": [ - "# Native GCP + Fabric\n", - "Stitching native GCP 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 = \"native-gcp-lzhang9\"\n", - "#fab_file_path = os.path.dirname(os.getcwd()) + \"/examples/gcp\"\n", - "fab_file_path = \"./examples/native-gcp\"\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": {}, - "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" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ee0f1096-c026-46ca-b39b-4c8a59e3d5f8", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "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 -} diff --git a/notebooks/sense-aws.ipynb b/notebooks/sense-aws.ipynb deleted file mode 100644 index 5a532c81..00000000 --- a/notebooks/sense-aws.ipynb +++ /dev/null @@ -1,180 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "4ed9aa05-01b2-4a98-9992-acd8f38615e2", - "metadata": {}, - "source": [ - "# SENSE AWS + Fabric\n", - "Stitching SENSE AWS 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 = \"sense-aws-lzhang9\"\n", - "#fab_file_path = os.path.dirname(os.getcwd()) + \"/examples/aws\"\n", - "fab_file_path = \"./examples/sense-aws\"\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" - ] - }, - { - "cell_type": "markdown", - "id": "138944ac-3892-41e2-a9cc-2c59383b5d63", - "metadata": {}, - "source": [ - "## Note: Amazon Instance Info\n", - "- EC2/Instances/i-078a7be6f4a3df5d6\n", - "- Private IPv4 10.0.1.106\n", - "- Public IPv4 54.242.87.34" - ] - } - ], - "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 -} diff --git a/notebooks/sense-gcp.ipynb b/notebooks/sense-gcp.ipynb deleted file mode 100644 index beabdcb8..00000000 --- a/notebooks/sense-gcp.ipynb +++ /dev/null @@ -1,178 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "4ed9aa05-01b2-4a98-9992-acd8f38615e2", - "metadata": {}, - "source": [ - "# SENSE GCP + Fabric\n", - "Stitching SENSE GCP 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 = \"sense-gcp-lzhang9\"\n", - "#fab_file_path = os.path.dirname(os.getcwd()) + \"/examples/gcp\"\n", - "fab_file_path = \"./examples/sense-gcp\"\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": {}, - "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" - ] - }, - { - "cell_type": "markdown", - "id": "67883063-3a57-4cdd-b14e-af35ea912f74", - "metadata": {}, - "source": [ - "## Note: VM Instance Info\n", - "- EC2/Instances/i-078a7be6f4a3df5d6\n", - "- Private IPv4 10.200.1.2\n", - "- Public IPv4 34.86.164.172" - ] - } - ], - "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 -}