Skip to content

Commit

Permalink
Document naming conventions & Naming alignment
Browse files Browse the repository at this point in the history
Contributed on behalf of STMicroelectronics
  • Loading branch information
jfaltermeier committed Oct 29, 2024
1 parent 8215bf1 commit d87764e
Show file tree
Hide file tree
Showing 37 changed files with 129 additions and 99 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ helm repo update
```bash
helm install theia-cloud-base theia-cloud-remote/theia-cloud-base --set [email protected]

helm install theia-cloud-crds theia-cloud-remote/theia-cloud-crds --namespace theiacloud --create-namespace
helm install theia-cloud-crds theia-cloud-remote/theia-cloud-crds --namespace theia-cloud --create-namespace

helm install theia-cloud theia-cloud-remote/theia-cloud --namespace theiacloud
helm install theia-cloud theia-cloud-remote/theia-cloud --namespace theia-cloud
```

### Install the current next version
Expand All @@ -112,21 +112,21 @@ Simply add the `--devel` flag:
```bash
helm install theia-cloud-base theia-cloud-remote/theia-cloud-base --set [email protected] --devel

helm install theia-cloud-crds theia-cloud-remote/theia-cloud-crds --namespace theiacloud --create-namespace --devel
helm install theia-cloud-crds theia-cloud-remote/theia-cloud-crds --namespace theia-cloud --create-namespace --devel

helm install theia-cloud theia-cloud-remote/theia-cloud --namespace theiacloud --devel
helm install theia-cloud theia-cloud-remote/theia-cloud --namespace theia-cloud --devel
```

### Optional: switch to the newly created namespace

```bash
kubectl config set-context --current --namespace=theiacloud
kubectl config set-context --current --namespace=theia-cloud
```

### Uninstall

```bash
helm uninstall theia-cloud -n theiacloud
helm uninstall theia-cloud -n theia-cloud
```

### Getting started with
Expand Down
4 changes: 2 additions & 2 deletions demo/dockerfiles/demo-theia-monitor-vscode/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM node:18-bullseye-slim as build-stage

# Copy and unzip the vsix file
RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
COPY theiacloud-monitor-0.12.0-next.vsix /tmp/theiacloud-monitor.vsix
RUN mkdir /tmp/extracted && unzip /tmp/theiacloud-monitor.vsix -d /tmp/extracted
COPY theia-cloud-monitor-0.12.0-next.vsix /tmp/theia-cloud-monitor.vsix
RUN mkdir /tmp/extracted && unzip /tmp/theia-cloud-monitor.vsix -d /tmp/extracted

FROM theiacloud/theia-cloud-demo:0.12.0-next as production-stage

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion documentation/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The Theia Cloud Operator listens for changes to custom resources inside the cluster. With those custom resources clients may trigger the creation/deletion/handling of workspaces and sessions. The Operator is responsible for handling all things that are related to the Kubernetes-Resources for workspaces and sessions. All access is authenticated via an Authenticator.

![Theia Cloud Diagram](theiacloud.png "Theia Cloud")
![Theia Cloud Diagram](theia-cloud.png "Theia Cloud")

## Operator Java Overview

Expand Down
16 changes: 8 additions & 8 deletions documentation/Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ helm repo update
```bash
helm install theia-cloud-base theia-cloud-remote/theia-cloud-base --set [email protected]

helm install theia-cloud-crds theia-cloud-remote/theia-cloud-crds --namespace theiacloud --create-namespace
helm install theia-cloud-crds theia-cloud-remote/theia-cloud-crds --namespace theia-cloud --create-namespace

helm install theia-cloud theia-cloud-remote/theia-cloud --namespace theiacloud
helm install theia-cloud theia-cloud-remote/theia-cloud --namespace theia-cloud
```

### Install the current next version
Expand All @@ -88,31 +88,31 @@ Simply add the `--devel` flag:
```bash
helm install theia-cloud-base theia-cloud-remote/theia-cloud-base --set [email protected] --devel

helm install theia-cloud-crds theia-cloud-remote/theia-cloud-crds --namespace theiacloud --create-namespace --devel
helm install theia-cloud-crds theia-cloud-remote/theia-cloud-crds --namespace theia-cloud --create-namespace --devel

helm install theia-cloud theia-cloud-remote/theia-cloud --namespace theiacloud --devel
helm install theia-cloud theia-cloud-remote/theia-cloud --namespace theia-cloud --devel
```

### Optional: switch to the newly created namespace

```bash
kubectl config set-context --current --namespace=theiacloud
kubectl config set-context --current --namespace=theia-cloud
```

### Trouble shooting

Recreate tls secret for sessions:

`kubectl delete secret ws-cert-secret -n theiacloud`
`kubectl delete secret ws-cert-secret -n theia-cloud`

## Check

```bash
helm get manifest theia-cloud -n theiacloud
helm get manifest theia-cloud -n theia-cloud
```

## Uninstall

```bash
helm uninstall theia-cloud -n theiacloud
helm uninstall theia-cloud -n theia-cloud
```
32 changes: 32 additions & 0 deletions documentation/Naming.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Naming Conventions

The project is called "Theia Cloud" (with a space) and is a subproject of Eclipse Theia.

As different languages and use cases use other conventions for naming, we try to follow these conventions as close as possible.

Please see below guidelines for know usages of specific style conventions.

## theia.cloud

In general, use `theia.cloud` in hierachies and for identifiers, e.g.

- Java package/jar names, e.g. `org.eclipse.theia.cloud`
- Java (system) properties , e.g. `-Dtheia.cloud.app.id=asdfghjkl`
- Group Names / Metadata Names in Kubernetes Custom Resource Definitions, e.g. `theia.cloud`, `theia.cloud/v1beta9`, `sessions.theia.cloud`
- Theia Command identifiers, e.g. `theia.cloud.monitor.activity.report`

## TheiaCloud / theiaCloud

Use Pascal Case / Camel Case in Java/Typescript class/method/property names, e.g. `DefaultTheiaCloudOperatorLauncher` or `window.theiaCloudConfig`.

Other uses are places where you usually may use any cases, but want to avoid spaces (for technical reasons), e.g. the KeyCloak Realm `TheiaCloud`.

## theia-cloud

## THEIA_CLOUD

## Theia Cloud

## theia-cloud.io

To follow conventions for labels in Kubernetes, we use our regular domain as a prefix for custom labels, e.g. `theia-cloud.io/workspace.name`
12 changes: 6 additions & 6 deletions documentation/operator.graphml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<y:Geometry height="28.0" width="100.0" x="1157.0" y="186.0"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="85.65625" x="7.171875" xml:space="preserve" y="3.0">TheiaCloud<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="90.18212890625" x="4.908935546875" xml:space="preserve" y="3.0">Theia Cloud<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
Expand Down Expand Up @@ -67,7 +67,7 @@ AppDefinitionAddedHandler<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></
<y:Geometry height="43.0" width="203.0" x="848.5" y="339.0"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.265625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="189.35791015625" x="6.821044921875" xml:space="preserve" y="3.0">&lt;&lt;interface&gt;&gt;
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="34.265625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="164.9892578125" x="19.00537109375" xml:space="preserve" y="3.0">&lt;&lt;interface&gt;&gt;
SessionAddedHandler<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
Expand Down Expand Up @@ -98,7 +98,7 @@ SessionAddedHandler<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:Labe
<y:Geometry height="28.0" width="279.0" x="1217.0" y="601.0"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="259.4296875" x="9.78515625" xml:space="preserve" y="3.0">LazyStartSessionAddedHandler<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="235.06103515625" x="21.969482421875" xml:space="preserve" y="3.0">LazyStartSessionAddedHandler<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
Expand All @@ -113,7 +113,7 @@ SessionAddedHandler<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:Labe
<y:Geometry height="28.0" width="279.0" x="699.0" y="638.0"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="268.51953125" x="5.240234375" xml:space="preserve" y="3.0">EagerStartSessionAddedHandler<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="19.1328125" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="244.15087890625" x="17.424560546875" xml:space="preserve" y="3.0">EagerStartSessionAddedHandler<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:UML clipContent="true" constraint="" hasDetailsColor="false" omitDetails="false" stereotype="" use3DEffect="true">
<y:AttributeLabel xml:space="preserve"/>
<y:MethodLabel xml:space="preserve"/>
Expand Down Expand Up @@ -143,7 +143,7 @@ SessionAddedHandler<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:Labe
<y:Geometry height="86.0" width="854.0" x="654.0" y="707.0"/>
<y:Fill color="#CCFFFF" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="73.84375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="846.208984375" x="4.0" xml:space="preserve" y="4.0">We may have different kinds of implementations of the handlers.
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="73.84375" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="826.38671875" x="4.0" xml:space="preserve" y="4.0">We may have different kinds of implementations of the handlers.
E.g. we might have handlers that start up unassigned pods already and assign the running pods to a user on session added (EagerStart)
Or we could do it Che-like and spin up the pod when a new session is added

Expand Down Expand Up @@ -174,7 +174,7 @@ IngressCreationService<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:L
<y:Geometry height="81.0" width="310.0" x="1375.0" y="159.5"/>
<y:Fill color="#FFCC00" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="34.265625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="298.3916015625" x="5.80419921875" xml:space="preserve" y="23.3671875">Listens for app definition/sessions changes
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="13" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="34.265625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="283.6904296875" x="13.15478515625" xml:space="preserve" y="23.3671875">Listens for app definition/sessions changes
and delegates to handlers<y:LabelModel><y:SmartNodeLabelModel distance="4.0"/></y:LabelModel><y:ModelParameter><y:SmartNodeLabelModelParameter labelRatioX="0.0" labelRatioY="0.0" nodeRatioX="0.0" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/></y:ModelParameter></y:NodeLabel>
<y:Shape type="ellipse"/>
</y:ShapeNode>
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion java/operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To debug the Default Theia Cloud Operator, follow these steps:
minikube ip
```

_Note_: Ensure your local `kubectl` is set to the correct namespace (e.g., `theiacloud`), as the debuggable operator will interact with your local Kubernetes cluster.
_Note_: Ensure your local `kubectl` is set to the correct namespace (e.g., `theia-cloud`), as the debuggable operator will interact with your local Kubernetes cluster.

### Theia Cloud Operator Library

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class EagerStartAppDefinitionAddedHandler implements AppDefinitionHandler

private static final Logger LOGGER = LogManager.getLogger(EagerStartAppDefinitionAddedHandler.class);

public static final String LABEL_KEY = "theiacloud";
public static final String LABEL_KEY = "theia-cloud.io/template-purpose";
public static final String LABEL_VALUE_PROXY = "proxy";
public static final String LABEL_VALUE_EMAILS = "emails";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ConfigMap
metadata:
name: placeholder-configname
labels:
theiacloud: proxy
theia-cloud.io/template-purpose: proxy
namespace: placeholder-namespace
ownerReferences:
- apiVersion: theia.cloud/v1beta9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ConfigMap
metadata:
name: placeholder-emailsconfigname
labels:
theiacloud: emails
theia-cloud.io/template-purpose: emails
namespace: placeholder-namespace
ownerReferences:
- apiVersion: theia.cloud/v1beta9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,29 @@ spec:
cpu: placeholder-cpu-requests
memory: placeholder-memory-requests
env:
- name: THEIACLOUD_APP_ID
- name: THEIA_CLOUD_APP_ID
value: placeholder-env-app-id
- name: THEIACLOUD_SERVICE_URL
- name: THEIA_CLOUD_SERVICE_URL
value: placeholder-env-service-url
- name: THEIACLOUD_SESSION_UID
- name: THEIA_CLOUD_SESSION_UID
value: placeholder-env-session-uid
- name: THEIACLOUD_SESSION_NAME
- name: THEIA_CLOUD_SESSION_NAME
value: placeholder-env-session-name
- name: THEIACLOUD_SESSION_USER
- name: THEIA_CLOUD_SESSION_USER
value: placeholder-env-session-user
- name: THEIACLOUD_SESSION_URL
- name: THEIA_CLOUD_SESSION_URL
value: placeholder-env-session-url
- name: THEIACLOUD_SESSION_SECRET
- name: THEIA_CLOUD_SESSION_SECRET
value: placeholder-env-session-secret
- name: THEIACLOUD_MONITOR_ENABLE_ACTIVITY_TRACKER
- name: THEIA_CLOUD_MONITOR_ENABLE_ACTIVITY_TRACKER
value: placeholder-enable-activity-tracker
- name: THEIACLOUD_MONITOR_PORT
- name: THEIA_CLOUD_MONITOR_PORT
value: placeholder-monitor-env-port
- name: THEIACLOUD_KEYCLOAK_URL
- name: THEIA_CLOUD_KEYCLOAK_URL
value: placeholder-keycloak-env-url
- name: THEIACLOUD_KEYCLOAK_REALM
- name: THEIA_CLOUD_KEYCLOAK_REALM
value: placeholder-keycloak-env-realm
- name: THEIACLOUD_KEYCLOAK_CLIENT_ID
- name: THEIA_CLOUD_KEYCLOAK_CLIENT_ID
value: placeholder-keycloak-env-clientid
securityContext:
runAsUser: placeholder-uid
Expand Down
Loading

0 comments on commit d87764e

Please sign in to comment.