Skip to content

Commit

Permalink
Upload the jar to the bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
Shmuma committed Oct 31, 2023
1 parent 4a163a3 commit ca46bd6
Showing 1 changed file with 152 additions and 6 deletions.
158 changes: 152 additions & 6 deletions doc/tutorials/cloud/00_setup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 19,
"id": "initial_id",
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2023-10-31T08:39:59.255115Z",
"start_time": "2023-10-31T08:39:58.937116Z"
"end_time": "2023-10-31T12:54:55.864998Z",
"start_time": "2023-10-31T12:54:55.794920Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Schema created in 76.59ms\n"
"Schema created in 55.96ms\n"
]
}
],
"source": [
"%run ../setup_db.ipynb\n",
"conf = SandboxConfig(EXTERNAL_HOST_NAME=\"127.0.0.1\", HOST_PORT=8563)\n",
"conf = SandboxConfig(EXTERNAL_HOST_NAME=\"127.0.0.1\", HOST_PORT=8563, BUCKETFS_PORT=2580)\n",
"setup_schema(conf)"
]
},
Expand Down Expand Up @@ -58,6 +58,16 @@
},
"id": "39d3eb644ca970c5"
},
{
"cell_type": "markdown",
"source": [
"# Retrieve the latest released jar file"
],
"metadata": {
"collapsed": false
},
"id": "5d0ea9b81b7ee1b5"
},
{
"cell_type": "code",
"execution_count": 3,
Expand Down Expand Up @@ -121,6 +131,142 @@
},
"id": "26a9c3d99a84c280"
},
{
"cell_type": "markdown",
"source": [
"# Upload the jar to the bucketfs"
],
"metadata": {
"collapsed": false
},
"id": "11f54801bd4f0e52"
},
{
"cell_type": "code",
"execution_count": 38,
"outputs": [],
"source": [
"from exasol import bucketfs"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-31T13:04:56.196743Z",
"start_time": "2023-10-31T13:04:56.192806Z"
}
},
"id": "22c106f0dce7686c"
},
{
"cell_type": "code",
"execution_count": 46,
"outputs": [],
"source": [
"UDFS_BUCKET = \"myudfs\""
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-31T13:05:34.722940Z",
"start_time": "2023-10-31T13:05:34.716676Z"
}
},
"id": "76848da2905675e4"
},
{
"cell_type": "code",
"execution_count": 39,
"outputs": [],
"source": [
"bfs_url = conf.BUCKETFS_URL_PREFIX + conf.EXTERNAL_BUCKETFS_HOST\n",
"bfs_creds = {\n",
" UDFS_BUCKET: {\n",
" \"username\": conf.BUCKETFS_USER,\n",
" \"password\": conf.BUCKETFS_PASSWORD,\n",
" } \n",
"}"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-31T13:04:56.818120Z",
"start_time": "2023-10-31T13:04:56.810084Z"
}
},
"id": "30f7167bfef7541f"
},
{
"cell_type": "code",
"execution_count": 40,
"outputs": [],
"source": [
"svc = bucketfs.Service(bfs_url, bfs_creds)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-31T13:04:57.776464Z",
"start_time": "2023-10-31T13:04:57.768738Z"
}
},
"id": "97cd73ff4671111b"
},
{
"cell_type": "code",
"execution_count": 42,
"outputs": [],
"source": [
"bucket = svc[UDFS_BUCKET]"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-31T13:05:00.470849Z",
"start_time": "2023-10-31T13:05:00.457197Z"
}
},
"id": "7a1edeb504facdda"
},
{
"cell_type": "code",
"execution_count": 50,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Jar file is already present in the bucketfs\n"
]
}
],
"source": [
"jar_exists = local_jar_name in list(bucket)\n",
"if jar_exists:\n",
" print(\"Jar file is already present in the bucketfs\")\n",
"else:\n",
" print(\"Upload jar to bucketfs\")\n",
" with local_jar_path.open(\"rb\") as fd:\n",
" bucket.upload(local_jar_name, fd) "
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-31T13:09:47.544790Z",
"start_time": "2023-10-31T13:09:47.527581Z"
}
},
"id": "43231d82c5d3cef8"
},
{
"cell_type": "markdown",
"source": [
"# Create connection script"
],
"metadata": {
"collapsed": false
},
"id": "54a1efeb33bc7a8"
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -129,7 +275,7 @@
"metadata": {
"collapsed": false
},
"id": "321aa2e89281542c"
"id": "6a11f64e0fd52c71"
}
],
"metadata": {
Expand Down

0 comments on commit ca46bd6

Please sign in to comment.