Skip to content

Commit

Permalink
Revove debugging print statement
Browse files Browse the repository at this point in the history
  • Loading branch information
tylere committed Jun 25, 2024
1 parent a04866f commit 8864166
Show file tree
Hide file tree
Showing 2 changed files with 239 additions and 6 deletions.
244 changes: 239 additions & 5 deletions 00_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
" def __init__(self, **kwargs):\n",
" print('InitEarthEngine.init: starting') # This appears in the notebook output where the cluster is initiated.\n",
" self.kwargs = kwargs\n",
" print(f'InitEarthEngine.init: kwargs = {kwargs}')\n",
"\n",
" def setup(self, worker):\n",
" # Print statements output to the dask cluster logs (viewable via Coiled dashboard)\n",
Expand Down Expand Up @@ -149,7 +148,32 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ClusterGEE init\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2024-06-25 07:27:45,250][INFO ][coiled] Resolving your local default Python environment...\n",
"[2024-06-25 07:27:56,526][INFO ][coiled] Creating Cluster (name: test-class-cluster, https://cloud.coiled.io/clusters/505936?account=tylere ). This usually takes 1-2 minutes...\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Google Application Default Credentials have been written to a file on your Coiled VM(s).\n",
"These credentials will potentially be valid until explicitly revoked by running\n",
"gcloud auth application-default revoke\n"
]
}
],
"source": [
"cluster = ClusterGEE(\n",
" name='test-class-cluster',\n",
Expand All @@ -173,7 +197,187 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ClusterGEE get_client\n",
"InitEarthEngine.init: starting\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px;\">Client</h3>\n",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-638c87d8-32ff-11ef-84e0-fe11494405b5</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
"\n",
" <tr>\n",
" \n",
" <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
" <td style=\"text-align: left;\"><strong>Cluster type:</strong> __main__.ClusterGEE</td>\n",
" \n",
" </tr>\n",
"\n",
" \n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"https://cluster-ysonu.dask.host/z8jKyCbSXIVx2pAk/status\" target=\"_blank\">https://cluster-ysonu.dask.host/z8jKyCbSXIVx2pAk/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" \n",
"\n",
" </table>\n",
"\n",
" \n",
"\n",
" \n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
" <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n",
" </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">ClusterGEE</h3>\n",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">test-class-cluster</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard:</strong> <a href=\"https://cluster-ysonu.dask.host/z8jKyCbSXIVx2pAk/status\" target=\"_blank\">https://cluster-ysonu.dask.host/z8jKyCbSXIVx2pAk/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 1\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 4\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total memory:</strong> 15.02 GiB\n",
" </td>\n",
" </tr>\n",
" \n",
" </table>\n",
"\n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\">\n",
" <h3 style=\"display: inline;\">Scheduler Info</h3>\n",
" </summary>\n",
"\n",
" <div style=\"\">\n",
" <div>\n",
" <div style=\"width: 24px; height: 24px; background-color: #FFF7E5; border: 3px solid #FF6132; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px;\">Scheduler</h3>\n",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-0612b84c-f388-4d1e-9495-0b25ef47c7a3</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm:</strong> tls://10.2.0.85:8786\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 1\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard:</strong> <a href=\"http://10.2.0.85:8787/status\" target=\"_blank\">http://10.2.0.85:8787/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 4\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Started:</strong> Just now\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total memory:</strong> 15.02 GiB\n",
" </td>\n",
" </tr>\n",
" </table>\n",
" </div>\n",
" </div>\n",
"\n",
" <details style=\"margin-left: 48px;\">\n",
" <summary style=\"margin-bottom: 20px;\">\n",
" <h3 style=\"display: inline;\">Workers</h3>\n",
" </summary>\n",
"\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: test-class-cluster-worker-31924985b5</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tls://10.2.0.84:38123\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 4\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://10.2.0.84:8787/status\" target=\"_blank\">http://10.2.0.84:8787/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 15.02 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tls://10.2.0.84:33847\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> /scratch/dask-scratch-space/worker-ys5ui6sq\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
"\n",
" </details>\n",
"</div>\n",
"\n",
" </details>\n",
" </div>\n",
"</div>\n",
" </details>\n",
" \n",
"\n",
" </div>\n",
"</div>"
],
"text/plain": [
"<Client: 'tls://10.2.0.85:8786' processes=1 threads=4, memory=15.02 GiB>"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"client = cluster.get_client()\n",
"client"
Expand All @@ -196,7 +400,29 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Submitting jobs...\n",
"...done\n",
"Gathering results...\n",
"...done\n"
]
},
{
"data": {
"text/plain": [
"[{'country': 'Abyei Area', 'area_km2': 10460, 'mean_elev': 402.5921903247955},\n",
" {'country': 'Zimbabwe', 'area_km2': 391916, 'mean_elev': 973.2955548809969}]"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Get a list of countries to analyze.\n",
"country_fc = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017')\n",
Expand Down Expand Up @@ -244,7 +470,15 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2024-06-25 07:30:01,603][INFO ][coiled] Cluster 505936 deleted successfully.\n"
]
}
],
"source": [
"cluster.shutdown()"
]
Expand Down
1 change: 0 additions & 1 deletion earthengine_dask/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class InitEarthEngine(dask.distributed.WorkerPlugin):
def __init__(self, **kwargs):
print('InitEarthEngine.init: starting') # This appears in the notebook output where the cluster is initiated.
self.kwargs = kwargs
print(f'InitEarthEngine.init: kwargs = {kwargs}')

def setup(self, worker):
# Print statements output to the dask cluster logs (viewable via Coiled dashboard)
Expand Down

0 comments on commit 8864166

Please sign in to comment.