Skip to content

Commit

Permalink
Fix: Use code-server reference in all the files
Browse files Browse the repository at this point in the history
Signed-off-by: Harshad Reddy Nalla <[email protected]>
  • Loading branch information
harshad16 committed Jan 24, 2024
1 parent cabc4dc commit 06664a3
Show file tree
Hide file tree
Showing 18 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ labels: 'kind/bug'
- OpenDatahub Version: (please check the operator version)
- Workbench: (all, data-science, etc)
- Workbench Version: (2023.1, etc)
- Specific tool: (jupyterlab, rstudio, vscode, elyra-pipelines,etc)
- Specific tool: (jupyterlab, rstudio, code-server, elyra-pipelines,etc)
- Notebook-Controller Version: (please check the image version in notebook-controller deployment)

**Logs/Screenshots**
10 changes: 5 additions & 5 deletions codeserver/c9s-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ FROM ${BASE_IMAGE}
ARG CODESERVER_VERSION=v4.16.1

LABEL name="odh-notebook-code-server-c9s-python-3.9" \
summary="Code Server (VS Code) image with python 3.9 based on CentOS Stream 9" \
description="Code Server (VS Code) image with python 3.9 based on CentOS Stream 9" \
io.k8s.display-name="Code Server (VS Code) image with python 3.9 based on CentOS Stream 9" \
io.k8s.description="Code Server (VS Code) image with python 3.9 based on CentOS Stream 9" \
summary="Code Server image with python 3.9 based on CentOS Stream 9" \
description="Code Server image with python 3.9 based on CentOS Stream 9" \
io.k8s.display-name="Code Server image with python 3.9 based on CentOS Stream 9" \
io.k8s.description="Code Server image with python 3.9 based on CentOS Stream 9" \
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
io.openshift.build.commit.ref="main" \
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/codeserver/c9s-python-3.9" \
Expand All @@ -21,7 +21,7 @@ WORKDIR /opt/app-root/bin
RUN yum install -y "https://github.com/coder/code-server/releases/download/${CODESERVER_VERSION}/code-server-${CODESERVER_VERSION/v/}-amd64.rpm" && \
yum -y clean all --enablerepo='*'

# Install NGINX to proxy VSCode and pass probes check
# Install NGINX to proxy Code-Server and pass probes check
ENV NGINX_VERSION=1.22 \
NGINX_SHORT_VER=122 \
NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \
Expand Down
2 changes: 1 addition & 1 deletion codeserver/c9s-python-3.9/nginx/api/kernels/access.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ echo "Status: 200"
echo "Content-type: application/json"
echo
# Query the heartbeat endpoint
HEALTHZ=$(curl -s http://127.0.0.1:8888/vscode/healthz)
HEALTHZ=$(curl -s http://127.0.0.1:8888/code-server/healthz)
# Extract last_activity | remove milliseconds
LAST_ACTIVITY_EPOCH=$(echo $HEALTHZ | grep -Po 'lastHeartbeat":\K.*?(?=})' | awk '{ print substr( $0, 1, length($0)-3 ) }')
# Convert to ISO8601 date format
Expand Down
2 changes: 1 addition & 1 deletion codeserver/c9s-python-3.9/nginx/httpconf/http.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ map $http_upgrade $connection_upgrade {

# Exclude heartbeat from logging for culling purposes
map $request $loggable {
~\/vscode\/healthz 0;
~\/codeserver\/healthz 0;
default 1;
}

Expand Down
18 changes: 9 additions & 9 deletions codeserver/c9s-python-3.9/nginx/serverconf/proxy.conf.template
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
###############
# api calls from probes get to VSCode /healthz endpoint
# api calls from probes get to Code-Server /healthz endpoint
###############
location = /api {
return 302 /vscode/healthz/;
return 302 /codeserver/healthz/;
access_log off;
}

location /api/ {
return 302 /vscode/healthz/;
return 302 /codeserver/healthz/;
access_log off;
}
###############
Expand All @@ -33,17 +33,17 @@ location /api/kernels/ {
###############

###############
# root and prefix get to VSCode endpoint
# root and prefix get to Code-Server endpoint
###############
location = / {
return 302 $custom_scheme://$http_host/vscode/;
return 302 $custom_scheme://$http_host/codeserver/;
}

location = /vscode {
return 302 $custom_scheme://$http_host/vscode/;
location = /codeserver {
return 302 $custom_scheme://$http_host/codeserver/;
}

location /vscode/ {
location /codeserver/ {
# Standard Code-Server/NGINX configuration
proxy_pass http://127.0.0.1:8787/;
proxy_http_version 1.1;
Expand All @@ -59,6 +59,6 @@ location /vscode/ {
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;

access_log /var/log/nginx/vscode.access.log json if=$loggable;
access_log /var/log/nginx/codeserver.access.log json if=$loggable;
}
###############
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
###############
# api calls from probes get to VSCode /healthz endpoint
# api calls from probes get to Code-Server /healthz endpoint
###############
location = ${NB_PREFIX}/api {
return 302 /vscode/healthz/;
return 302 /codeserver/healthz/;
access_log off;
}

location ${NB_PREFIX}/api/ {
return 302 /vscode/healthz/;
return 302 /codeserver/healthz/;
access_log off;
}
###############
Expand Down Expand Up @@ -38,26 +38,26 @@ location /api/kernels/ {
###############

###############
# root and prefix get to VSCode endpoint
# root and prefix get to Code-Server endpoint
###############
location = ${NB_PREFIX} {
return 302 $custom_scheme://$http_host/vscode/;
return 302 $custom_scheme://$http_host/codeserver/;
}

location ${NB_PREFIX}/ {
return 302 $custom_scheme://$http_host/vscode/;
return 302 $custom_scheme://$http_host/codeserver/;
}

location = /vscode {
return 302 $custom_scheme://$http_host/vscode/;
location = /codeserver {
return 302 $custom_scheme://$http_host/codeserver/;
}

location = / {
return 302 $custom_scheme://$http_host/vscode/;
return 302 $custom_scheme://$http_host/codeserver/;
}

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

access_log /var/log/nginx/vscode.access.log json if=$loggable;
access_log /var/log/nginx/codeserver.access.log json if=$loggable;
}
###############
4 changes: 2 additions & 2 deletions codeserver/c9s-python-3.9/run-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ if [ ! -f "/opt/app-root/src/.bashrc" ]; then
fi

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

# Start server
start_process /usr/bin/code-server \
start_process /usr/bin/codeserver \
--bind-addr 0.0.0.0:8787 \
--disable-telemetry \
--auth none \
Expand Down
10 changes: 5 additions & 5 deletions codeserver/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ FROM ${BASE_IMAGE}
ARG CODESERVER_VERSION=v4.16.1

LABEL name="odh-notebook-code-server-ubi9-python-3.9" \
summary="Code Server (VS Code) image with python 3.9 based on UBI 9" \
description="Code Server (VS Code) image with python 3.9 based on UBI9" \
io.k8s.display-name="Code Server (VS Code) image with python 3.9 based on UBI9" \
io.k8s.description="Code Server (VS Code) image with python 3.9 based on UBI9" \
summary="Code Server image with python 3.9 based on UBI 9" \
description="Code Server image with python 3.9 based on UBI9" \
io.k8s.display-name="Code Server image with python 3.9 based on UBI9" \
io.k8s.description="Code Server image with python 3.9 based on UBI9" \
authoritative-source-url="https://github.com/opendatahub-io/notebooks" \
io.openshift.build.commit.ref="main" \
io.openshift.build.source-location="https://github.com/opendatahub-io/notebooks/tree/main/codeserver/ubi9-python-3.9" \
Expand Down Expand Up @@ -39,7 +39,7 @@ RUN yum install -y "https://github.com/coder/code-server/releases/download/${COD
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
fix-permissions /opt/app-root -P

# Install NGINX to proxy VSCode and pass probes check
# Install NGINX to proxy Code-Server and pass probes check
ENV NGINX_VERSION=1.22 \
NGINX_SHORT_VER=122 \
NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \
Expand Down
2 changes: 1 addition & 1 deletion codeserver/ubi9-python-3.9/nginx/api/kernels/access.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ echo "Status: 200"
echo "Content-type: application/json"
echo
# Query the heartbeat endpoint
HEALTHZ=$(curl -s http://127.0.0.1:8888/vscode/healthz)
HEALTHZ=$(curl -s http://127.0.0.1:8888/codeserver/healthz)
# Extract last_activity | remove milliseconds
LAST_ACTIVITY_EPOCH=$(echo $HEALTHZ | grep -Po 'lastHeartbeat":\K.*?(?=})' | awk '{ print substr( $0, 1, length($0)-3 ) }')
# Convert to ISO8601 date format
Expand Down
2 changes: 1 addition & 1 deletion codeserver/ubi9-python-3.9/nginx/httpconf/http.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ map $http_upgrade $connection_upgrade {

# Exclude heartbeat from logging for culling purposes
map $request $loggable {
~\/vscode\/healthz 0;
~\/codeserver\/healthz 0;
default 1;
}

Expand Down
18 changes: 9 additions & 9 deletions codeserver/ubi9-python-3.9/nginx/serverconf/proxy.conf.template
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
###############
# api calls from probes get to VSCode /healthz endpoint
# api calls from probes get to Code-Server /healthz endpoint
###############
location = /api {
return 302 /vscode/healthz/;
return 302 /codeserver/healthz/;
access_log off;
}

location /api/ {
return 302 /vscode/healthz/;
return 302 /codeserver/healthz/;
access_log off;
}
###############
Expand All @@ -33,17 +33,17 @@ location /api/kernels/ {
###############

###############
# root and prefix get to VSCode endpoint
# root and prefix get to Code-Server endpoint
###############
location = / {
return 302 $custom_scheme://$http_host/vscode/;
return 302 $custom_scheme://$http_host/codeserver/;
}

location = /vscode {
return 302 $custom_scheme://$http_host/vscode/;
location = /codeserver {
return 302 $custom_scheme://$http_host/codeserver/;
}

location /vscode/ {
location /codeserver/ {
# Standard Code-Server/NGINX configuration
proxy_pass http://127.0.0.1:8787/;
proxy_http_version 1.1;
Expand All @@ -59,6 +59,6 @@ location /vscode/ {
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;

access_log /var/log/nginx/vscode.access.log json if=$loggable;
access_log /var/log/nginx/codeserver.access.log json if=$loggable;
}
###############
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
###############
# api calls from probes get to VSCode /healthz endpoint
# api calls from probes get to Code-Server /healthz endpoint
###############
location = ${NB_PREFIX}/api {
return 302 /vscode/healthz/;
return 302 /codeserver/healthz/;
access_log off;
}

location ${NB_PREFIX}/api/ {
return 302 /vscode/healthz/;
return 302 /codeserver/healthz/;
access_log off;
}
###############
Expand Down Expand Up @@ -38,26 +38,26 @@ location /api/kernels/ {
###############

###############
# root and prefix get to VSCode endpoint
# root and prefix get to Code-Server endpoint
###############
location = ${NB_PREFIX} {
return 302 $custom_scheme://$http_host/vscode/;
return 302 $custom_scheme://$http_host/codeserver/;
}

location ${NB_PREFIX}/ {
return 302 $custom_scheme://$http_host/vscode/;
return 302 $custom_scheme://$http_host/codeserver/;
}

location = /vscode {
return 302 $custom_scheme://$http_host/vscode/;
location = /codeserver {
return 302 $custom_scheme://$http_host/codeserver/;
}

location = / {
return 302 $custom_scheme://$http_host/vscode/;
return 302 $custom_scheme://$http_host/codeserver/;
}

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

access_log /var/log/nginx/vscode.access.log json if=$loggable;
access_log /var/log/nginx/codeserver.access.log json if=$loggable;
}
###############
6 changes: 3 additions & 3 deletions codeserver/ubi9-python-3.9/run-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ if [ ! -f "/opt/app-root/src/.bashrc" ]; then
fi

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

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

# Check internet connection
if curl -Is http://www.google.com | head -n 1 | grep -q "200 OK"; then
Expand All @@ -42,7 +42,7 @@ if [ ! -f "/opt/app-root/src/.local/share/code-server" ]; then
fi

# Start server
start_process /usr/bin/code-server \
start_process /usr/bin/codeserver \
--bind-addr 0.0.0.0:8787 \
--disable-telemetry \
--auth none \
Expand Down
18 changes: 9 additions & 9 deletions docs/Incorporate-database-cients-on-code-server.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Incorporate standard database clients on code server (vs code)
# Incorporate standard database clients on code server (code-server)

## Introduction

In the field of Database Management Systems effective interaction is crucial for developers. Incorporating standard database clients directly into your VS Code environment can streamline your workflow, offering a seamless interface for managing databases. This tutorial will walk you through the process of incorporating different Database Management System clients into Code Server, whether through built-in extensions within VS Code or by creating your own custom image.
In the field of Database Management Systems effective interaction is crucial for developers. Incorporating standard database clients directly into your Code-Server environment can streamline your workflow, offering a seamless interface for managing databases. This tutorial will walk you through the process of incorporating different Database Management System clients into Code Server, whether through built-in extensions within Code-Server or by creating your own custom image.

## 1. Through Extensions

Expand All @@ -12,25 +12,25 @@ In the field of Database Management Systems effective interaction is crucial for

2. Search for the desired extension using the provided recommended links.

3. Click "Install" to add the extension to your VS Code environment.
3. Click "Install" to add the extension to your Code-Server environment.

### Recommended extensions list

**MongoDB for VS Code**
**MongoDB for Code-Server**

MongoDB for VS Code empowers you to connect to MongoDB and Atlas directly from your VS Code environment. Explore databases and collections, inspect schemas, and prototype queries and aggregations effortlessly using the integrated playgrounds.
MongoDB for Code-Serverempowers you to connect to MongoDB and Atlas directly from your Code-Server environment. Explore databases and collections, inspect schemas, and prototype queries and aggregations effortlessly using the integrated playgrounds.

[Link to Extension](https://marketplace.visualstudio.com/items?itemName=mongodb.mongodb-vscode)

**MySQL Shell for VS Code**
**MySQL Shell for Code-Server**

This extension provides a robust MySQL Shell for VS Code, enhancing your capability to manage MySQL databases seamlessly within the VS Code environment.
This extension provides a robust MySQL Shell for Code-Server, enhancing your capability to manage MySQL databases seamlessly within the Code-Server environment.

[Link to Extension](https://marketplace.visualstudio.com/items?itemName=Oracle.mysql-shell-for-vs-code)

**SQL Server (MSSQL)**

Connect to SQL Server effortlessly with this extension, enabling you to perform database tasks directly from your VS Code workspace.
Connect to SQL Server effortlessly with this extension, enabling you to perform database tasks directly from your Code-Server workspace.

[Link to Extension](https://marketplace.visualstudio.com/items?itemName=ms-mssql.mssql)

Expand All @@ -48,7 +48,7 @@ SQLTools simplifies database connections, supporting a wide array of commonly us

**Database Client**

This versatile extension serves as a database manager for MySQL/MariaDB, PostgreSQL, SQLite, Redis, and ElasticSearch. It provides a unified interface for managing diverse databases within the VS Code environment.
This versatile extension serves as a database manager for MySQL/MariaDB, PostgreSQL, SQLite, Redis, and ElasticSearch. It provides a unified interface for managing diverse databases within the Code-Server environment.

[Link to Extension](https://marketplace.visualstudio.com/items?itemName=cweijan.vscode-database-client2)

Expand Down
Loading

0 comments on commit 06664a3

Please sign in to comment.