Skip to content

Commit 879392e

Browse files
authored
Merge pull request opendatahub-io#390 from harshad16/fix-naming-codeserver
Fix: Use code-server reference in all the files
2 parents cabc4dc + 2305f1e commit 879392e

File tree

20 files changed

+87
-87
lines changed

20 files changed

+87
-87
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ labels: 'kind/bug'
2020
- OpenDatahub Version: (please check the operator version)
2121
- Workbench: (all, data-science, etc)
2222
- Workbench Version: (2023.1, etc)
23-
- Specific tool: (jupyterlab, rstudio, vscode, elyra-pipelines,etc)
23+
- Specific tool: (jupyterlab, rstudio, code-server, elyra-pipelines,etc)
2424
- Notebook-Controller Version: (please check the image version in notebook-controller deployment)
2525

2626
**Logs/Screenshots**

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ validate-runtime-image: bin/kubectl
411411
.PHONY: validate-codeserver-image
412412
validate-codeserver-image: bin/kubectl
413413
$(eval NOTEBOOK_NAME := $(subst .,-,$(subst cuda-,,$*)))
414-
$(info # Running tests for $(NOTEBOOK_NAME) Code Server image...)
414+
$(info # Running tests for $(NOTEBOOK_NAME) code-server image...)
415415
$(KUBECTL_BIN) wait --for=condition=ready pod codeserver-pod --timeout=300s
416416
@required_commands=$(REQUIRED_CODE_SERVER_IMAGE_COMMANDS) ; \
417417
if [[ $$image == "" ]] ; then \
@@ -431,7 +431,7 @@ validate-codeserver-image: bin/kubectl
431431
.PHONY: validate-rstudio-image
432432
validate-rstudio-image: bin/kubectl
433433
$(eval NOTEBOOK_NAME := $(subst .,-,$(subst cuda-,,$*)))
434-
$(info # Running tests for $(NOTEBOOK_NAME) Code Server image...)
434+
$(info # Running tests for $(NOTEBOOK_NAME) code-server image...)
435435
$(KUBECTL_BIN) wait --for=condition=ready pod rstudio-pod --timeout=300s
436436
@required_commands=$(REQUIRED_R_STUDIO_IMAGE_COMMANDS) ; \
437437
if [[ $$image == "" ]] ; then \

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ graph TB
123123
subgraph Other Notebooks
124124
%% Nodes
125125
c9s-python-3.9("CentOS Stream Base<br/>(c9s-python-3.9)");
126-
code-server-c9s-python-3.9("Code Server <br/>(code-server-c9s-python-3.9)");
126+
code-server-c9s-python-3.9("code-server <br/>(code-server-c9s-python-3.9)");
127127
r-studio-c9s-python-3.9("R Studio <br/>(r-studio-c9s-python-3.9)");
128128
129129
%% Edges

codeserver/c9s-python-3.9/Dockerfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ FROM ${BASE_IMAGE}
44
ARG CODESERVER_VERSION=v4.16.1
55

66
LABEL name="odh-notebook-code-server-c9s-python-3.9" \
7-
summary="Code Server (VS Code) image with python 3.9 based on CentOS Stream 9" \
8-
description="Code Server (VS Code) image with python 3.9 based on CentOS Stream 9" \
9-
io.k8s.display-name="Code Server (VS Code) image with python 3.9 based on CentOS Stream 9" \
10-
io.k8s.description="Code Server (VS Code) image with python 3.9 based on CentOS Stream 9" \
7+
summary="code-server image with python 3.9 based on CentOS Stream 9" \
8+
description="code-server image with python 3.9 based on CentOS Stream 9" \
9+
io.k8s.display-name="code-server image with python 3.9 based on CentOS Stream 9" \
10+
io.k8s.description="code-server image with python 3.9 based on CentOS Stream 9" \
1111
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
1212
io.openshift.build.commit.ref="main" \
1313
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/codeserver/c9s-python-3.9" \
@@ -17,11 +17,11 @@ USER 0
1717

1818
WORKDIR /opt/app-root/bin
1919

20-
# Install Code Server
20+
# Install code-server
2121
RUN yum install -y "https://github.com/coder/code-server/releases/download/${CODESERVER_VERSION}/code-server-${CODESERVER_VERSION/v/}-amd64.rpm" && \
2222
yum -y clean all --enablerepo='*'
2323

24-
# Install NGINX to proxy VSCode and pass probes check
24+
# Install NGINX to proxy code-server and pass probes check
2525
ENV NGINX_VERSION=1.22 \
2626
NGINX_SHORT_VER=122 \
2727
NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \

codeserver/c9s-python-3.9/nginx/api/kernels/access.cgi

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ echo "Status: 200"
33
echo "Content-type: application/json"
44
echo
55
# Query the heartbeat endpoint
6-
HEALTHZ=$(curl -s http://127.0.0.1:8888/vscode/healthz)
6+
HEALTHZ=$(curl -s http://127.0.0.1:8888/codeserver/healthz)
77
# Extract last_activity | remove milliseconds
88
LAST_ACTIVITY_EPOCH=$(echo $HEALTHZ | grep -Po 'lastHeartbeat":\K.*?(?=})' | awk '{ print substr( $0, 1, length($0)-3 ) }')
99
# Convert to ISO8601 date format

codeserver/c9s-python-3.9/nginx/httpconf/http.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ map $http_upgrade $connection_upgrade {
1010

1111
# Exclude heartbeat from logging for culling purposes
1212
map $request $loggable {
13-
~\/vscode\/healthz 0;
13+
~\/codeserver\/healthz 0;
1414
default 1;
1515
}
1616

codeserver/c9s-python-3.9/nginx/serverconf/proxy.conf.template

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
###############
2-
# api calls from probes get to VSCode /healthz endpoint
2+
# api calls from probes get to code-server /healthz endpoint
33
###############
44
location = /api {
5-
return 302 /vscode/healthz/;
5+
return 302 /codeserver/healthz/;
66
access_log off;
77
}
88

99
location /api/ {
10-
return 302 /vscode/healthz/;
10+
return 302 /codeserver/healthz/;
1111
access_log off;
1212
}
1313
###############
@@ -33,18 +33,18 @@ location /api/kernels/ {
3333
###############
3434

3535
###############
36-
# root and prefix get to VSCode endpoint
36+
# root and prefix get to code-server endpoint
3737
###############
3838
location = / {
39-
return 302 $custom_scheme://$http_host/vscode/;
39+
return 302 $custom_scheme://$http_host/codeserver/;
4040
}
4141

42-
location = /vscode {
43-
return 302 $custom_scheme://$http_host/vscode/;
42+
location = /codeserver {
43+
return 302 $custom_scheme://$http_host/codeserver/;
4444
}
4545

46-
location /vscode/ {
47-
# Standard Code-Server/NGINX configuration
46+
location /codeserver/ {
47+
# Standard code-server/NGINX configuration
4848
proxy_pass http://127.0.0.1:8787/;
4949
proxy_http_version 1.1;
5050
proxy_set_header Upgrade $http_upgrade;
@@ -59,6 +59,6 @@ location /vscode/ {
5959
proxy_set_header X-NginX-Proxy true;
6060
proxy_redirect off;
6161

62-
access_log /var/log/nginx/vscode.access.log json if=$loggable;
62+
access_log /var/log/nginx/codeserver.access.log json if=$loggable;
6363
}
6464
###############

codeserver/c9s-python-3.9/nginx/serverconf/proxy.conf.template_nbprefix

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
###############
2-
# api calls from probes get to VSCode /healthz endpoint
2+
# api calls from probes get to code-server /healthz endpoint
33
###############
44
location = ${NB_PREFIX}/api {
5-
return 302 /vscode/healthz/;
5+
return 302 /codeserver/healthz/;
66
access_log off;
77
}
88

99
location ${NB_PREFIX}/api/ {
10-
return 302 /vscode/healthz/;
10+
return 302 /codeserver/healthz/;
1111
access_log off;
1212
}
1313
###############
@@ -38,26 +38,26 @@ location /api/kernels/ {
3838
###############
3939

4040
###############
41-
# root and prefix get to VSCode endpoint
41+
# root and prefix get to code-server endpoint
4242
###############
4343
location = ${NB_PREFIX} {
44-
return 302 $custom_scheme://$http_host/vscode/;
44+
return 302 $custom_scheme://$http_host/codeserver/;
4545
}
4646

4747
location ${NB_PREFIX}/ {
48-
return 302 $custom_scheme://$http_host/vscode/;
48+
return 302 $custom_scheme://$http_host/codeserver/;
4949
}
5050

51-
location = /vscode {
52-
return 302 $custom_scheme://$http_host/vscode/;
51+
location = /codeserver {
52+
return 302 $custom_scheme://$http_host/codeserver/;
5353
}
5454

5555
location = / {
56-
return 302 $custom_scheme://$http_host/vscode/;
56+
return 302 $custom_scheme://$http_host/codeserver/;
5757
}
5858

59-
location /vscode/ {
60-
rewrite ^/vscode/(.*)$ /$1 break;
59+
location /codeserver/ {
60+
rewrite ^/codeserver/(.*)$ /$1 break;
6161
# Standard RStudio/NGINX configuration
6262
proxy_pass http://127.0.0.1:8787;
6363
proxy_http_version 1.1;
@@ -66,6 +66,6 @@ location /vscode/ {
6666
proxy_read_timeout 20d;
6767
proxy_set_header X-Forwarded-Proto $custom_scheme;
6868

69-
access_log /var/log/nginx/vscode.access.log json if=$loggable;
69+
access_log /var/log/nginx/codeserver.access.log json if=$loggable;
7070
}
7171
###############

codeserver/c9s-python-3.9/run-code-server.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ ! -f "/opt/app-root/src/.bashrc" ]; then
1414
fi
1515

1616
# Initilize access logs for culling
17-
echo '[{"id":"code-server","name":"code-server","last_activity":"'$(date -Iseconds)'","execution_state":"running","connections":1}]' > /var/log/nginx/vscode.access.log
17+
echo '[{"id":"code-server","name":"code-server","last_activity":"'$(date -Iseconds)'","execution_state":"running","connections":1}]' > /var/log/nginx/codeserver.access.log
1818

1919
# Start server
2020
start_process /usr/bin/code-server \

codeserver/ubi9-python-3.9/Dockerfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ FROM ${BASE_IMAGE}
44
ARG CODESERVER_VERSION=v4.16.1
55

66
LABEL name="odh-notebook-code-server-ubi9-python-3.9" \
7-
summary="Code Server (VS Code) image with python 3.9 based on UBI 9" \
8-
description="Code Server (VS Code) image with python 3.9 based on UBI9" \
9-
io.k8s.display-name="Code Server (VS Code) image with python 3.9 based on UBI9" \
10-
io.k8s.description="Code Server (VS Code) image with python 3.9 based on UBI9" \
7+
summary="code-server image with python 3.9 based on UBI 9" \
8+
description="code-server image with python 3.9 based on UBI9" \
9+
io.k8s.display-name="code-server image with python 3.9 based on UBI9" \
10+
io.k8s.description="code-server image with python 3.9 based on UBI9" \
1111
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
1212
io.openshift.build.commit.ref="main" \
1313
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/codeserver/ubi9-python-3.9" \
@@ -31,15 +31,15 @@ RUN echo "Installing softwares and packages" && \
3131
# Install usefull OS packages
3232
RUN dnf install -y jq git-lfs libsndfile
3333

34-
# Install Code Server
34+
# Install code-server
3535
RUN yum install -y "https://github.com/coder/code-server/releases/download/${CODESERVER_VERSION}/code-server-${CODESERVER_VERSION/v/}-amd64.rpm" && \
3636
yum -y clean all --enablerepo='*'
3737

3838
# Change ownership of relevant directories
3939
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
4040
fix-permissions /opt/app-root -P
4141

42-
# Install NGINX to proxy VSCode and pass probes check
42+
# Install NGINX to proxy code-server and pass probes check
4343
ENV NGINX_VERSION=1.22 \
4444
NGINX_SHORT_VER=122 \
4545
NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \

codeserver/ubi9-python-3.9/nginx/api/kernels/access.cgi

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ echo "Status: 200"
33
echo "Content-type: application/json"
44
echo
55
# Query the heartbeat endpoint
6-
HEALTHZ=$(curl -s http://127.0.0.1:8888/vscode/healthz)
6+
HEALTHZ=$(curl -s http://127.0.0.1:8888/codeserver/healthz)
77
# Extract last_activity | remove milliseconds
88
LAST_ACTIVITY_EPOCH=$(echo $HEALTHZ | grep -Po 'lastHeartbeat":\K.*?(?=})' | awk '{ print substr( $0, 1, length($0)-3 ) }')
99
# Convert to ISO8601 date format

codeserver/ubi9-python-3.9/nginx/httpconf/http.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ map $http_upgrade $connection_upgrade {
1010

1111
# Exclude heartbeat from logging for culling purposes
1212
map $request $loggable {
13-
~\/vscode\/healthz 0;
13+
~\/codeserver\/healthz 0;
1414
default 1;
1515
}
1616

codeserver/ubi9-python-3.9/nginx/serverconf/proxy.conf.template

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
###############
2-
# api calls from probes get to VSCode /healthz endpoint
2+
# api calls from probes get to code-server /healthz endpoint
33
###############
44
location = /api {
5-
return 302 /vscode/healthz/;
5+
return 302 /codeserver/healthz/;
66
access_log off;
77
}
88

99
location /api/ {
10-
return 302 /vscode/healthz/;
10+
return 302 /codeserver/healthz/;
1111
access_log off;
1212
}
1313
###############
@@ -33,18 +33,18 @@ location /api/kernels/ {
3333
###############
3434

3535
###############
36-
# root and prefix get to VSCode endpoint
36+
# root and prefix get to code-server endpoint
3737
###############
3838
location = / {
39-
return 302 $custom_scheme://$http_host/vscode/;
39+
return 302 $custom_scheme://$http_host/codeserver/;
4040
}
4141

42-
location = /vscode {
43-
return 302 $custom_scheme://$http_host/vscode/;
42+
location = /codeserver {
43+
return 302 $custom_scheme://$http_host/codeserver/;
4444
}
4545

46-
location /vscode/ {
47-
# Standard Code-Server/NGINX configuration
46+
location /codeserver/ {
47+
# Standard code-server/NGINX configuration
4848
proxy_pass http://127.0.0.1:8787/;
4949
proxy_http_version 1.1;
5050
proxy_set_header Upgrade $http_upgrade;
@@ -59,6 +59,6 @@ location /vscode/ {
5959
proxy_set_header X-NginX-Proxy true;
6060
proxy_redirect off;
6161

62-
access_log /var/log/nginx/vscode.access.log json if=$loggable;
62+
access_log /var/log/nginx/codeserver.access.log json if=$loggable;
6363
}
6464
###############

codeserver/ubi9-python-3.9/nginx/serverconf/proxy.conf.template_nbprefix

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
###############
2-
# api calls from probes get to VSCode /healthz endpoint
2+
# api calls from probes get to code-server /healthz endpoint
33
###############
44
location = ${NB_PREFIX}/api {
5-
return 302 /vscode/healthz/;
5+
return 302 /codeserver/healthz/;
66
access_log off;
77
}
88

99
location ${NB_PREFIX}/api/ {
10-
return 302 /vscode/healthz/;
10+
return 302 /codeserver/healthz/;
1111
access_log off;
1212
}
1313
###############
@@ -38,26 +38,26 @@ location /api/kernels/ {
3838
###############
3939

4040
###############
41-
# root and prefix get to VSCode endpoint
41+
# root and prefix get to code-server endpoint
4242
###############
4343
location = ${NB_PREFIX} {
44-
return 302 $custom_scheme://$http_host/vscode/;
44+
return 302 $custom_scheme://$http_host/codeserver/;
4545
}
4646

4747
location ${NB_PREFIX}/ {
48-
return 302 $custom_scheme://$http_host/vscode/;
48+
return 302 $custom_scheme://$http_host/codeserver/;
4949
}
5050

51-
location = /vscode {
52-
return 302 $custom_scheme://$http_host/vscode/;
51+
location = /codeserver {
52+
return 302 $custom_scheme://$http_host/codeserver/;
5353
}
5454

5555
location = / {
56-
return 302 $custom_scheme://$http_host/vscode/;
56+
return 302 $custom_scheme://$http_host/codeserver/;
5757
}
5858

59-
location /vscode/ {
60-
rewrite ^/vscode/(.*)$ /$1 break;
59+
location /codeserver/ {
60+
rewrite ^/codeserver/(.*)$ /$1 break;
6161
# Standard RStudio/NGINX configuration
6262
proxy_pass http://127.0.0.1:8787;
6363
proxy_http_version 1.1;
@@ -66,6 +66,6 @@ location /vscode/ {
6666
proxy_read_timeout 20d;
6767
proxy_set_header X-Forwarded-Proto $custom_scheme;
6868

69-
access_log /var/log/nginx/vscode.access.log json if=$loggable;
69+
access_log /var/log/nginx/codeserver.access.log json if=$loggable;
7070
}
7171
###############

codeserver/ubi9-python-3.9/run-code-server.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ if [ ! -f "/opt/app-root/src/.bashrc" ]; then
1414
fi
1515

1616
# Initilize access logs for culling
17-
echo '[{"id":"code-server","name":"code-server","last_activity":"'$(date -Iseconds)'","execution_state":"running","connections":1}]' > /var/log/nginx/vscode.access.log
17+
echo '[{"id":"code-server","name":"code-server","last_activity":"'$(date -Iseconds)'","execution_state":"running","connections":1}]' > /var/log/nginx/codeserver.access.log
1818

1919
# Check if code-server exists
20-
if [ ! -f "/opt/app-root/src/.local/share/code-server" ]; then
20+
if [ ! -f "/opt/app-root/src/.local/share/codeserver" ]; then
2121

2222
# Check internet connection
2323
if curl -Is http://www.google.com | head -n 1 | grep -q "200 OK"; then

0 commit comments

Comments
 (0)