Skip to content

Commit

Permalink
Updated notebooks to use debs created by github actions (#47)
Browse files Browse the repository at this point in the history
Updated existing LBCP notebook to E2SAR-development-tester which now
downloads boost/grpc dependencies from Github workflow actions rather
than using the binary artifacts(which can be removed later)

Created another notebook E2SAR-release-tester which donwloads the
release debian package and installs it. This notebook can be used to
test releases and for integration of E2SAR
  • Loading branch information
ibaldin authored Sep 16, 2024
2 parents f2d626c + eccf74b commit bb14873
Show file tree
Hide file tree
Showing 5 changed files with 780 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"## Preparation and overview\n",
"\n",
"- Be sure to [generate a keypair for Jupyter Hub](GitHubSSH.ipynb) and register it with GitHub - the keys will be used to check out the code from private repositories, like [UDPLBd](https://github.com/esnet/udplbd) and [E2SAR](https://github.com/JeffersonLab/E2SAR).\n",
"- Note that for E2SAR development and testing sender and receiver node compile/build environments will be setup via post-boot scripts ([sender](post-boot/sender.sh) and [receiver](post-boot/recver.sh)) and grpc++ is installed as a tar.gz with static and dynamic libraries compiled for ubuntu22\n",
"- Note that for E2SAR development and testing sender and receiver node compile/build environments will be setup via post-boot scripts ([sender](post-boot/sender.sh) and [receiver](post-boot/recver.sh)) and grpc++/boost is installed as a debian package from [Github releases](https://github.com/JeffersonLab/E2SAR/releases) with static and dynamic libraries compiled for ubuntu22\n",
"- This does not setup the control plane node for anything, but testing a specific version - you can set which branch of UDPLBd to check out and a containerized version is built and stood up."
]
},
Expand Down Expand Up @@ -59,13 +59,16 @@
"# which of the available config files to use with UDPLBd\n",
"udplbd_config = 'lb_mock-tls.yml'\n",
"\n",
"#base distro type - either default or docker\n",
"distro_types = ['default','docker']\n",
"distro_type = distro_types[0]\n",
"\n",
"# base distro 'ubuntu' or 'rocky'\n",
"distro_name = 'ubuntu'\n",
"\n",
"binary_extension = {\n",
" 'ubuntu': 'ubuntu22',\n",
" 'rocky': 'rocky8'\n",
"}[distro_name]\n",
"#base distro version, currently only for ubuntu 20,22,24. E2SAR dependencies will be \n",
"#downloaded for the appropriate versions.\n",
"distro_version = '22'\n",
"\n",
"# note that the below is distribution specific ('ubuntu' for ubuntu and so on)\n",
"home_location = {\n",
Expand All @@ -75,17 +78,18 @@
"\n",
"vm_key_location = f'{home_location}/.ssh/github_ecdsa'\n",
"\n",
"# grpc tar ball stored in E2SAR repo (via LFS)\n",
"grpc_tar = f\"grpc-v1.54.1-{binary_extension}.tar.gz\"\n",
"boost_tar = f\"boost-v1.85.0-{binary_extension}.tar.gz\"\n",
"\n",
"# which test suites in E2SAR to run (leave empty to run all)\n",
"# you can set 'unit' or 'live' to run unit or live tests only\n",
"e2sar_test_suite = ''\n",
"\n",
"# name of the network connecting the nodes\n",
"net_name = 'site_bridge_net'\n",
"\n",
"# url of e2sar deps. Find the appropriate version for the OS at https://github.com/JeffersonLab/E2SAR/releases\n",
"static_release_url = 'https://github.com/JeffersonLab/E2SAR/releases/download/' # don't need to change this\n",
"e2sar_dep_artifcat = 'e2sar-deps_0.1.0_amd64.deb'\n",
"e2sar_release_ver = 'E2SAR-0.1.0'\n",
"e2sar_dep_url = static_release_url + e2sar_release_ver + \"-\" + distro_name + \"-\" + distro_version + \".04/\" + e2sar_dep_artifcat\n",
"\n",
"#\n",
"# SHOULDN'T NEED TO EDIT BELOW\n",
Expand All @@ -103,10 +107,9 @@
"fablib = fablib_manager() \n",
"fablib.show_config();\n",
"\n",
"images = {\n",
" 'ubuntu': ('default_ubuntu_22', 'docker_ubuntu_22'),\n",
" 'rocky': ('default_rocky_8', 'docker_rocky_8')\n",
"}\n",
"# Using docker image for cpnode by default\n",
"distro_image = distro_type + '_' + distro_name + '_' + distro_version\n",
"cp_distro_image = distro_types[1] + '_' + distro_name + '_' + distro_version\n",
"\n",
"# variable settings\n",
"slice_name = f'UDP LB Control Plane Testing with udplbd[{udplbd_branch}], e2sar[{e2sar_branch}] on {distro_name}'\n",
Expand All @@ -117,19 +120,19 @@
"node_config = {\n",
" 'sender': {\n",
" 'ip':'192.168.0.1', \n",
" 'image': images[distro_name][0],\n",
" 'image': distro_image,\n",
" 'cores': 8,\n",
" 'ram': 24,\n",
" 'disk': 100 },\n",
" 'recver': {\n",
" 'ip':'192.168.0.2', \n",
" 'image':images[distro_name][0],\n",
" 'image':distro_image,\n",
" 'cores':8,\n",
" 'ram': 24,\n",
" 'disk': 100 },\n",
" 'cpnode': {\n",
" 'ip':'192.168.0.3', \n",
" 'image':images[distro_name][1],\n",
" 'image':distro_image,\n",
" 'cores':8,\n",
" 'ram': 8,\n",
" 'disk': 100 },\n",
Expand Down Expand Up @@ -414,8 +417,8 @@
" f\"chmod go-rwx {vm_key_location}\",\n",
" # Meson won't detect boost by merely setting cmake_prefix_path, instead set BOOST_ROOT env variable \n",
" # for gRPC it is enough to set -Dpkg_config_path option to meson\n",
" f\"echo 'export BOOST_ROOT=$HOME/boost-install PATH=$HOME/.local/bin:$HOME/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib' >> ~/.profile\",\n",
" f\"echo 'export BOOST_ROOT=$HOME/boost-install PATH=$HOME/.local/bin:$HOME/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib' >> ~/.bashrc\",\n",
" f\"echo 'export BOOST_ROOT=/usr/local/ LD_LIBRARY_PATH=/usr/local/lib' >> ~/.profile\",\n",
" f\"echo 'export BOOST_ROOT=/usr/local/ LD_LIBRARY_PATH=/usr/local/lib' >> ~/.bashrc\",\n",
"]\n",
"\n",
"for node in [sender, recver]: \n",
Expand All @@ -427,15 +430,29 @@
{
"cell_type": "code",
"execution_count": null,
"id": "813f3afc-f8cf-40f9-81c5-8eceffb1df74",
"id": "24e529e2-ec01-451f-91a3-52b1462a496d",
"metadata": {},
"outputs": [],
"source": [
"#download boost and grpc dependencies from releases\n",
"commands = [\n",
" f\"wget -q -O boost_grpc.deb {e2sar_dep_url}\",\n",
" f\"sudo apt -yq install ./boost_grpc.deb\",\n",
"]\n",
" \n",
"execute_commands([sender, recver], commands)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e8cf2d4e-7602-4cdd-ba55-b7abfe0b5538",
"metadata": {},
"outputs": [],
"source": [
"# checkout E2SAR (including the right branch) using that key, install grpc and boost binary that is stored in the repo\n",
"commands = [\n",
" f\"GIT_SSH_COMMAND='ssh -i {vm_key_location} -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git clone --recurse-submodules --depth 1 -b {e2sar_branch} [email protected]:JeffersonLab/E2SAR.git\",\n",
" f\"tar -zxf E2SAR/binary_artifacts/{grpc_tar}\",\n",
" f\"tar -zxf E2SAR/binary_artifacts/{boost_tar}\",\n",
" #f\"cd E2SAR; GIT_SSH_COMMAND='ssh -i {vm_key_location} -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git submodule init\",\n",
"]\n",
" \n",
Expand Down Expand Up @@ -476,13 +493,13 @@
"# (other tests simply ignore the parts of the URI they don't need.)\n",
"\n",
"commands = [\n",
" f\"cd E2SAR; BOOST_ROOT=$HOME/boost-install PATH=$HOME/.local/bin:$HOME/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib meson setup -Dpkg_config_path=$HOME/grpc-install/lib/pkgconfig/:$HOME/grpc-install/lib64/pkgconfig/ --prefix {home_location}/e2sar-install build && sed -i 's/-std=c++11//g' build/build.ninja\",\n",
" f\"cd E2SAR/build; PATH=$HOME/.local/bin:$HOME/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib meson compile -j 8\",\n",
" f\"cd E2SAR/build; PATH=$HOME/.local/bin:$HOME/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib meson test {e2sar_test_suite} --suite unit --timeout 0\",\n",
"# f\"cd E2SAR/build; EJFAT_URI='ejfats://udplbd@{cpnode_addr}:18347/lb/1?data=127.0.0.1&sync=192.168.88.199:1234' PATH=$HOME/.local/bin:$HOME/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib meson test {e2sar_test_suite} --suite live --timeout 0\"\n",
" f\"cd E2SAR; PATH=$HOME/.local/bin:/usr/local/bin:$PATH BOOST_ROOT=/usr/local/ LD_LIBRARY_PATH=/usr/local/lib/ meson setup -Dpkg_config_path=/usr/local/lib/pkgconfig/:/usr/lib/lib64/pkgconfig/ --prefix {home_location}/e2sar-install build && sed -i 's/-std=c++11//g' build/build.ninja\",\n",
" f\"cd E2SAR/build; PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ meson compile -j 8\",\n",
" f\"cd E2SAR/build; PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ meson test {e2sar_test_suite} --suite unit --timeout 0\",\n",
"# f\"cd E2SAR/build; EJFAT_URI='ejfats://udplbd@{cpnode_addr}:18347/lb/1?data=127.0.0.1&sync=192.168.88.199:1234' PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ meson test {e2sar_test_suite} --suite live --timeout 0\"\n",
"]\n",
" \n",
"execute_commands([sender, recver], commands)"
"execute_commands([sender], commands)"
]
},
{
Expand All @@ -508,10 +525,10 @@
"\n",
"commands = [\n",
" f\"cd E2SAR; GIT_SSH_COMMAND='ssh -i {vm_key_location} -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git pull origin {e2sar_branch}\",\n",
" f\"cd E2SAR; BOOST_ROOT=$HOME/boost-install PATH=$HOME/.local/bin:$HOME/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib meson setup -Dpkg_config_path=$HOME/grpc-install/lib/pkgconfig/:$HOME/grpc-install/lib64/pkgconfig/ --prefix {home_location}/e2sar-install build --wipe && sed -i 's/-std=c++11//g' build/build.ninja\",\n",
" f\"cd E2SAR/build; PATH=$HOME/.local/bin:/home/ubuntu/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib meson compile -j 8\",\n",
" f\"cd E2SAR/build; PATH=$HOME/.local/bin:$HOME/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib meson test {e2sar_test_suite} --suite unit --timeout 0\",\n",
"# f\"cd E2SAR/build; EJFAT_URI='ejfats://udplbd@{cpnode_addr}:18347/lb/1?data=127.0.0.1&sync=192.168.88.199:1234' PATH=$HOME/.local/bin:$HOME/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib meson test {e2sar_test_suite} --suite live --timeout 0\"\n",
" f\"cd E2SAR; BOOST_ROOT=/usr/local/ PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ meson setup -Dpkg_config_path=/usr/local/lib/pkgconfig/:/usr/lib/lib64/pkgconfig/ --prefix {home_location}/e2sar-install build --wipe && sed -i 's/-std=c++11//g' build/build.ninja\",\n",
" f\"cd E2SAR/build; PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ meson compile -j 8\",\n",
" f\"cd E2SAR/build; PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ meson test {e2sar_test_suite} --suite unit --timeout 0\",\n",
"# f\"cd E2SAR/build; EJFAT_URI='ejfats://udplbd@{cpnode_addr}:18347/lb/1?data=127.0.0.1&sync=192.168.88.199:1234' PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ meson test {e2sar_test_suite} --suite live --timeout 0\"\n",
"]\n",
" \n",
"execute_commands([sender, recver], commands)"
Expand All @@ -536,9 +553,9 @@
"outputs": [],
"source": [
"commands = [\n",
" f\"cd E2SAR; BOOST_ROOT=$HOME/boost-install PATH=$HOME/.local/bin:$HOME/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib meson setup -Dpkg_config_path=$HOME/grpc-install/lib/pkgconfig/:$HOME/grpc-install/lib64/pkgconfig/ --prefix {home_location}/e2sar-install build && sed -i 's/-std=c++11//g' build/build.ninja\",\n",
" f\"cd E2SAR/build; PATH=$HOME/.local/bin:/home/ubuntu/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib meson install\",\n",
" f\"EJFAT_URI='ejfats://udplbd@{cpnode_addr}:18347?sync=192.168.100.10:19020&data=192.168.101.10:18020' PATH=$HOME/.local/bin:/home/ubuntu/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib ~/e2sar-install/bin/lbadm --reserve -e -v -6 -l myLib -d 01 -a 192.168.0.3\",\n",
" f\"cd E2SAR; BOOST_ROOT=/usr/local/ PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ meson setup -Dpkg_config_path=$HOME/grpc-install/lib/pkgconfig/:$HOME/grpc-install/lib64/pkgconfig/ --prefix {home_location}/e2sar-install build && sed -i 's/-std=c++11//g' build/build.ninja\",\n",
" f\"cd E2SAR/build; PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ meson install\",\n",
" f\"EJFAT_URI='ejfats://udplbd@{cpnode_addr}:18347?sync=192.168.100.10:19020&data=192.168.101.10:18020' PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ ~/e2sar-install/bin/lbadm --reserve -e -v -6 -l myLib -d 01 -a 192.168.0.3\",\n",
"]\n",
"execute_commands(sender,commands)"
]
Expand All @@ -552,7 +569,7 @@
"source": [
"#using option e to suppress messages\n",
"commands = [\n",
" f\"EJFAT_URI='ejfats://udplbd@{cpnode_addr}:18347?sync=192.168.100.10:19020&data=192.168.101.10:18020' PATH=$HOME/.local/bin:/home/ubuntu/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib ~/e2sar-install/bin/lbadm --reserve -e -v -6 -l myLib -d 01 -a 192.168.0.3\",\n",
" f\"EJFAT_URI='ejfats://udplbd@{cpnode_addr}:18347?sync=192.168.100.10:19020&data=192.168.101.10:18020' PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ ~/e2sar-install/bin/lbadm --reserve -e -v -6 -l myLib -d 01 -a 192.168.0.3\",\n",
"]\n",
"execute_commands(sender,commands)"
]
Expand All @@ -567,7 +584,7 @@
"#need to replace the EJFAT_URI created in the last step\n",
"ejfat_uri = \"ejfats://999e421bf36382c8cb07f1ac3a355afccf9ed0e9e0e0d1e91947bc21d57170e6@192.168.0.3:18347/lb/1?sync=192.168.0.3:19531&data=192.0.2.1&data=[2001:db8::1]\"\n",
"commands = [\n",
" f\"EJFAT_URI='{ejfat_uri}' PATH=$HOME/.local/bin:/home/ubuntu/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib ~/e2sar-install/bin/lbmon -v -6\"\n",
" f\"EJFAT_URI='{ejfat_uri}' PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ ~/e2sar-install/bin/lbmon -v -6\"\n",
"]\n",
"execute_commands(sender,commands)"
]
Expand All @@ -581,7 +598,7 @@
"source": [
"#No need to replace uri, because we are using admin token and getting the overview of the LB\n",
"commands = [\n",
" f\"EJFAT_URI='ejfats://[email protected]:18347' PATH=$HOME/.local/bin:/home/ubuntu/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib ~/e2sar-install/bin/lbmon -v -6\"\n",
" f\"EJFAT_URI='ejfats://[email protected]:18347' PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ ~/e2sar-install/bin/lbmon -v -6\"\n",
"]\n",
"execute_commands(sender,commands)"
]
Expand Down Expand Up @@ -661,8 +678,8 @@
"numEvents = 10000 # number of events to send\n",
"bufSize = 300 * 1024 * 1024 # 100MB send and receive buffers\n",
"\n",
"recv_command = f\"cd E2SAR; PATH=$HOME/.local/bin:/home/ubuntu/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib ./build/bin/e2sar_perf -r -u '{e2sarPerfURI}' -d {recverDuration} -b {bufSize}\"\n",
"send_command = f\"cd E2SAR; PATH=$HOME/.local/bin:/home/ubuntu/grpc-install/bin:$PATH LD_LIBRARY_PATH=$HOME/grpc-install/lib/:$HOME/boost-install/lib ./build/bin/e2sar_perf -s -u '{e2sarPerfURI}' --mtu {mtu} --rate {rate} --length {length} -n {numEvents} -b {bufSize}\"\n",
"recv_command = f\"cd E2SAR; PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ ./build/bin/e2sar_perf -r -u '{e2sarPerfURI}' -d {recverDuration} -b {bufSize}\"\n",
"send_command = f\"cd E2SAR; PATH=$HOME/.local/bin:/usr/local/bin:$PATH LD_LIBRARY_PATH=/usr/local/lib/ ./build/bin/e2sar_perf -s -u '{e2sarPerfURI}' --mtu {mtu} --rate {rate} --length {length} -n {numEvents} -b {bufSize}\"\n",
"\n",
"# start the receiver for 10 seconds and log its output\n",
"print(f'Executing command {recv_command} on receiver')\n",
Expand Down
Loading

0 comments on commit bb14873

Please sign in to comment.