Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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.25.0
COPY . /app
26 changes: 25 additions & 1 deletion workers/mesh_worker.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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()
Expand Down
Loading