Skip to content

Commit 8e43047

Browse files
committed
Unify Docker image by removing SageMaker variant
Serve a single Docker image instead of separate main and SageMaker variants. The frontend now uses relative asset and API paths so it works behind any reverse proxy without build-time path knowledge, and all database requests route through the same-origin proxy server. - Resolve API endpoints relative to document.baseURI via apiUrl() - Remove the proxyConnection toggle and proxy endpoint url from the connection model; graphDbUrl is the canonical database URL - Migrate legacy stored connections at read time - Move SageMaker runtime defaults (port, log style, SSL) into process-environment.sh, driven by NEPTUNE_NOTEBOOK - Publish the unified image under both regular and sagemaker-* tags
1 parent 7ebed77 commit 8e43047

43 files changed

Lines changed: 631 additions & 556 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
IMAGE_TAG: ${{ steps.get-image-tag.outputs.image_tag }}
7171
run: |
7272
docker build -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG .
73-
docker build --build-arg NEPTUNE_NOTEBOOK=true -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:sagemaker-$IMAGE_TAG .
73+
docker tag $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:sagemaker-$IMAGE_TAG
7474
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
7575
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:sagemaker-$IMAGE_TAG
7676

.github/workflows/test_build_docker.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
- name: Build Docker image
2525
run: |
2626
docker build -t test-image .
27-
docker build -t test-image-neptune --build-arg NEPTUNE_NOTEBOOK=true .
2827
2928
- name: Scan Docker image for vulnerabilities
3029
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
@@ -36,7 +35,6 @@ jobs:
3635
- name: Ensure openSSL is installed
3736
run: |
3837
docker run --rm --entrypoint="" test-image openssl --version
39-
docker run --rm --entrypoint="" test-image-neptune openssl --version
4038
4139
- name: Verify unnecessary packages are removed
4240
run: |
@@ -48,14 +46,6 @@ jobs:
4846
(command -v yum && echo "FAIL: yum found" && exit 1) || echo "✓ yum removed"
4947
(command -v dnf && echo "FAIL: dnf found" && exit 1) || echo "✓ dnf removed"
5048
'
51-
docker run --rm --entrypoint="" test-image-neptune sh -c '
52-
(command -v npm && echo "FAIL: npm found" && exit 1) || echo "✓ npm removed"
53-
(command -v pnpm && echo "FAIL: pnpm found" && exit 1) || echo "✓ pnpm removed"
54-
(command -v corepack && echo "FAIL: corepack found" && exit 1) || echo "✓ corepack removed"
55-
(command -v python3 && echo "FAIL: python3 found" && exit 1) || echo "✓ python3 removed"
56-
(command -v yum && echo "FAIL: yum found" && exit 1) || echo "✓ yum removed"
57-
(command -v dnf && echo "FAIL: dnf found" && exit 1) || echo "✓ dnf removed"
58-
'
5949
6050
- name: Verify server starts and responds
6151
run: |

Dockerfile

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,9 @@ RUN yum update -y --releasever 2023.12.20260622 && \
2020
rm -rf /var/cache/yum /var/cache/dnf
2121

2222
FROM base
23-
ARG NEPTUNE_NOTEBOOK
2423

25-
ENV NEPTUNE_NOTEBOOK=$NEPTUNE_NOTEBOOK
2624
ENV HOME=/graph-explorer
2725

28-
# Conditionally set the following environment values using +/- variable expansion
29-
# https://docs.docker.com/reference/dockerfile/#environment-replacement
30-
#
31-
# If NEPTUNE_NOTEBOOK value is set then
32-
# - GRAPH_EXP_ENV_ROOT_FOLDER = /proxy/9250/explorer
33-
# - PROXY_SERVER_HTTP_PORT = 9250
34-
# - LOG_STYLE = cloudwatch
35-
# Else the values are the defaults
36-
# - GRAPH_EXP_ENV_ROOT_FOLDER = /explorer
37-
# - PROXY_SERVER_HTTP_PORT = 80
38-
# - LOG_STYLE = default
39-
40-
ENV GRAPH_EXP_ENV_ROOT_FOLDER=${NEPTUNE_NOTEBOOK:+/proxy/9250/explorer}
41-
ENV GRAPH_EXP_ENV_ROOT_FOLDER=${GRAPH_EXP_ENV_ROOT_FOLDER:-/explorer}
42-
43-
ENV PROXY_SERVER_HTTP_PORT=${NEPTUNE_NOTEBOOK:+9250}
44-
ENV PROXY_SERVER_HTTP_PORT=${PROXY_SERVER_HTTP_PORT:-80}
45-
46-
ENV LOG_STYLE=${NEPTUNE_NOTEBOOK:+cloudwatch}
47-
ENV LOG_STYLE=${LOG_STYLE:-default}
48-
4926
WORKDIR /
5027
COPY . /graph-explorer/
5128
WORKDIR /graph-explorer

docs/guides/deploy-to-sagemaker/install-graph-explorer-lc.sh

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,14 @@ LATEST_ECR_RELEASE=$(curl -k -H "Authorization: Bearer $ECR_TOKEN" https://publi
130130
131131
echo "Pulling and starting graph-explorer..."
132132
if [[ ${EXPLORER_VERSION} == "" ]]; then
133-
EXPLORER_ECR_TAG=sagemaker-${LATEST_ECR_RELEASE}
133+
EXPLORER_ECR_TAG=${LATEST_ECR_RELEASE}
134134
else
135-
if [[ ${EXPLORER_VERSION//./} -ge 140 ]]; then
136-
EXPLORER_ECR_TAG=sagemaker-${EXPLORER_VERSION}
137-
elif [[ ${EXPLORER_VERSION} == *latest* ]]; then
138-
EXPLORER_ECR_TAG=sagemaker-latest-SNAPSHOT
135+
if [[ ${EXPLORER_VERSION} == *latest* ]]; then
136+
EXPLORER_ECR_TAG=latest-SNAPSHOT
139137
elif [[ ${EXPLORER_VERSION} == *dev* ]]; then
140-
EXPLORER_ECR_TAG=sagemaker-dev
138+
EXPLORER_ECR_TAG=dev
141139
else
142-
echo "Specified Graph Explorer version does not support use on SageMaker. Defaulting to latest release."
143-
EXPLORER_ECR_TAG=sagemaker-${LATEST_ECR_RELEASE}
140+
EXPLORER_ECR_TAG=${EXPLORER_VERSION}
144141
fi
145142
fi
146143
echo "Using explorer image tag: ${EXPLORER_ECR_TAG}"
@@ -155,13 +152,10 @@ start_graph_explorer_with_cw_logs() {
155152
--log-opt awslogs-multiline-pattern='^(INFO|DEBUG|ERROR|WARN|TRACE|FATAL)' \
156153
--env LOG_LEVEL=debug \
157154
--env HOST=127.0.0.1 \
158-
--env PUBLIC_OR_PROXY_ENDPOINT=${EXPLORER_URI} \
159155
--env GRAPH_CONNECTION_URL=${NEPTUNE_URI} \
160-
--env USING_PROXY_SERVER=true \
161156
--env IAM=${IAM} \
162157
--env AWS_REGION=${AWS_REGION} \
163158
--env SERVICE_TYPE=${SERVICE} \
164-
--env PROXY_SERVER_HTTPS_CONNECTION=false \
165159
--env NEPTUNE_NOTEBOOK=true public.ecr.aws/neptune/graph-explorer:${EXPLORER_ECR_TAG}
166160
}
167161
@@ -170,13 +164,10 @@ start_graph_explorer_with_default_logs() {
170164
--restart always \
171165
--env LOG_LEVEL=debug \
172166
--env HOST=127.0.0.1 \
173-
--env PUBLIC_OR_PROXY_ENDPOINT=${EXPLORER_URI} \
174167
--env GRAPH_CONNECTION_URL=${NEPTUNE_URI} \
175-
--env USING_PROXY_SERVER=true \
176168
--env IAM=${IAM} \
177169
--env AWS_REGION=${AWS_REGION} \
178170
--env SERVICE_TYPE=${SERVICE} \
179-
--env PROXY_SERVER_HTTPS_CONNECTION=false \
180171
--env NEPTUNE_NOTEBOOK=true public.ecr.aws/neptune/graph-explorer:${EXPLORER_ECR_TAG}
181172
}
182173

0 commit comments

Comments
 (0)