Skip to content
Merged
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
2 changes: 1 addition & 1 deletion packages/smartem-workspace/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "smartem-workspace"
version = "0.6.1"
version = "0.7.0"
description = "CLI tool to automate SmartEM multi-repo workspace setup"
readme = "README.md"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/smartem-workspace/smartem_workspace/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""SmartEM workspace setup CLI tool."""

__version__ = "0.6.1"
__version__ = "0.7.0"
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def setup_workspace_structure(workspace_path: Path) -> bool:
- repos/
- tmp/
- testdata/
- testdata/dls-filesystem/ (local mirror of Diamond's /dls shared filesystem;
populated by hand with microscopy imagery and mounted into the dev backend
pod at /dls so image-serving endpoints can resolve DB /dls/... paths)

Returns:
True if successful
Expand All @@ -26,6 +29,8 @@ def setup_workspace_structure(workspace_path: Path) -> bool:
"repos",
"tmp",
"testdata",
# Mirrors Diamond's /dls DFS root; mounted into the dev backend at /dls.
"testdata/dls-filesystem",
]

for dir_name in directories:
Expand Down
43 changes: 43 additions & 0 deletions scripts/k8s/dev-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,46 @@ ensure_local_image() {
fi
}

# Mount the local DLS-filesystem mirror into the API pod so image-serving endpoints can
# read atlas/grid-square files that the DB references by absolute /dls/... paths. hostPath
# must be absolute and kustomize can't template, so (like the configmap/secret steps) we
# patch the live deployment here. API service only: the worker never reads image files.
# The mirror lives at <workspace>/testdata/dls-filesystem by convention; override with
# SMARTEM_DLS_FILESYSTEM_DIR. Skipped silently when absent (images show placeholders).
ensure_image_mount() {
local workspace_root dls_dir
workspace_root="$(cd "$PROJECT_ROOT/../../.." 2>/dev/null && pwd)"
dls_dir="${SMARTEM_DLS_FILESYSTEM_DIR:-$workspace_root/testdata/dls-filesystem}"

if [[ ! -d "$dls_dir" ]]; then
log_info "No DLS-filesystem mirror at $dls_dir - skipping image mount (atlas/grid-square images will show placeholders)"
return 0
fi

log_info "Mounting DLS-filesystem mirror into smartem-http-api: $dls_dir -> /dls"
if kubectl patch deployment smartem-http-api -n "$NAMESPACE" --type strategic --patch "$(cat <<PATCH
spec:
template:
spec:
containers:
- name: smartem-http-api
volumeMounts:
- name: dls-filesystem
mountPath: /dls
readOnly: true
volumes:
- name: dls-filesystem
hostPath:
path: $dls_dir
type: Directory
PATCH
)" &> /dev/null; then
log_success "DLS-filesystem mount applied to smartem-http-api"
else
log_warning "Could not apply DLS-filesystem mount (non-fatal; images will show placeholders)"
fi
}

# Deploy the environment
deploy_environment() {
log_info "Deploying development environment..."
Expand All @@ -440,6 +480,9 @@ deploy_environment() {
# Ensure local image is built and available for development
ensure_local_image

# Mount the local DLS-filesystem mirror so the API can serve atlas/grid-square images
ensure_image_mount

log_success "Deployment initiated"
}

Expand Down
Loading