From 513b60f3140c1f80532f1b964aeb24e8a357b82a Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Sat, 9 May 2026 09:07:22 -0700 Subject: [PATCH 1/2] hacking meshfix for v1 --- Dockerfile | 8 +------- workers/mesh_worker.py | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index c26ffdc1b..66b1c2a3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,2 @@ -# FROM gcr.io/neuromancer-seung-import/pychunkedgraph:graph-tool_dracopy -FROM seunglab/pychunkedgraph:graph-tool_dracopy -COPY override/timeout.conf /etc/nginx/conf.d/timeout.conf -COPY override/supervisord.conf /etc/supervisor/conf.d/supervisord.conf -COPY requirements.txt /app -RUN pip install --upgrade pip \ - && pip install --no-cache-dir --upgrade -r requirements.txt +FROM docker.io/caveconnectome/pychunkedgraph:v1.27.0 COPY . /app \ No newline at end of file diff --git a/workers/mesh_worker.py b/workers/mesh_worker.py index 2d65260d6..52edac2b8 100644 --- a/workers/mesh_worker.py +++ b/workers/mesh_worker.py @@ -1,6 +1,24 @@ from os import getenv from messagingclient import MessagingClient +from google.cloud import bigtable +from google.auth import credentials +from google.auth import default as default_creds +from google.cloud import bigtable + +class DoNothingCreds(credentials.Credentials): + def refresh(self, request): + pass + +def get_bigtable_client(project_id, emulate=False): + if emulate: + creds = DoNothingCreds() + elif project_id is not None: + creds, _ = default_creds() + else: + creds, project_id = default_creds() + client = bigtable.Client(admin=True, project=project_id, credentials=creds) + return client def callback(payload): @@ -24,7 +42,13 @@ def callback(payload): logging.info(f"Remeshing {new_lvl2_ids.size} L2 IDs in graph {table_id}") logging.info(f"stop_layer={layer}, mip={mip}, max_err={err}") - cg = ChunkedGraph(table_id) + project = getenv("BIGTABLE_PROJECT", "neuromancer-seung-import") + instance = getenv("BIGTABLE_INSTANCE", "pychunkedgraph") + client = get_bigtable_client(project_id=project) + cg=ChunkedGraph( + table_id, instance_id=instance, client=client + ) + meshgen.remeshing(cg, new_lvl2_ids, stop_layer=layer, mip=mip, max_err=err) logging.info("Remeshing complete.") gc.collect() From 8acaed55110ca44fa71b9e94778173abe4f3d0cc Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Sat, 9 May 2026 09:14:50 -0700 Subject: [PATCH 2/2] backing up base version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 66b1c2a3c..983ad6308 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,2 @@ -FROM docker.io/caveconnectome/pychunkedgraph:v1.27.0 +FROM docker.io/caveconnectome/pychunkedgraph:v1.25.0 COPY . /app \ No newline at end of file