Skip to content

Commit

Permalink
Adjust Workspace.Next model classes to latest updates in the Workspac…
Browse files Browse the repository at this point in the history
…e.Next vision (#10246)

Rework model, of CheService and renamed it to ChePlugin. 
Replace features hosting to apache server to be able to host plugin files and avoiding having model files for Go lang.
Host YAMLs instead of JSONs. Downloads and parse ChePlugin YAMLs instead of JSONs from the marketplace.
Improve unit tests coverage. 
Add support of Che Server protocol and path, so it is possible to run Classic GWT IDE in Workspace Next now.
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
  • Loading branch information
Oleksandr Garagatyi committed Jul 4, 2018
1 parent c989282 commit 9fe9021
Show file tree
Hide file tree
Showing 29 changed files with 1,233 additions and 1,177 deletions.
4 changes: 2 additions & 2 deletions deploy/kubernetes/kubectl/Deploy Che.md
Expand Up @@ -35,5 +35,5 @@ and clean redeploy of Che.
- Check Che pod status until it become `Running`: `kubectl get --namespace=che pods`

### Workspace Next:
There is a file `wsnext/feature-api.yaml` which contains kubesrv service needed to test Workspace Next on kubernetes infrastructure.
To use it call `kubectl apply --namespace=che -f wsnext/feature-api.yaml` and Che will be able to use Workspace Next flow.
There is a file `wsnext/feature-api.yaml` which contains apache service that hosts Workspace.Next files. It is needed to test Workspace.Next.
To use it call `kubectl apply --namespace=che -f wsnext/feature-api.yaml` and Che will be able to use Workspace.Next flow.
2 changes: 1 addition & 1 deletion deploy/kubernetes/kubectl/che-kubernetes.yaml
Expand Up @@ -72,7 +72,7 @@ items:
CHE_LOGS_APPENDERS_IMPL: "plaintext"
CHE_INFRA_KUBERNETES_INGRESS_DOMAIN: "192.168.99.100.nip.io"
CHE_INFRA_KUBERNETES_SERVER__STRATEGY: "default-host"
CHE_WORKSPACE_FEATURE_API: "http://feature-api-service:3000"
CHE_WORKSPACE_FEATURE_API: "http://marketplace:80"
- apiVersion: extensions/v1beta1
kind: Ingress
metadata:
Expand Down
17 changes: 17 additions & 0 deletions deploy/kubernetes/kubectl/wsnext/Dockerfile
@@ -0,0 +1,17 @@
FROM alpine/git:latest as clonning
# If value is git marketplace files will be cloned from git repo in $STORAGE_REPO
# Otherwise files will be copied from $STORAGE_PATH.
# Make sure $STORAGE_PATH is in the build context
ARG STORAGE_TYPE=git
ARG STORAGE_REPO=https://github.com/garagatyi/marketplace-storage
ARG STORAGE_PATH=.
COPY $STORAGE_PATH /tmp/local-marketplace-storage
RUN mkdir /tmp/marketplace-storage && \
if [ "$STORAGE_TYPE" == "git" ]; then \
git clone $STORAGE_REPO /tmp/marketplace-storage; \
else \
cp -r /tmp/local-marketplace-storage/* /tmp/marketplace-storage/; \
fi

FROM centos/httpd-24-centos7
COPY --from=clonning /tmp/marketplace-storage/ /var/www/html/
24 changes: 24 additions & 0 deletions deploy/kubernetes/kubectl/wsnext/Readme.md
@@ -0,0 +1,24 @@
## Build marketplace docker image

Execute
```shell
docker build --no-cache -t garagatyi/che-marketplace:1 .
```
Where `--no-cache` is needed to prevent usage of cached layers with marketplace files.
Useful when you change marketplace files and rebuild the image.

`-t garagatyi/che-marketplace:1` is needed to set identifier of the image. Do not forget to change `feature-api/yaml` file accordingly if you change this identifier to something else.

## Use custome repository as a source of marketplace files

To use a custom git repo as a source of marketplace files use next command to build the image:
```shell
docker build --no-cache -t garagatyi/che-marketplace:1 --build-arg STORAGE_REPO=https://github.com/someuser/somerepo .
```

## Use local path as a source of marketplace files

To use local path as a source of marketplace files use next command to build the image:
```shell
docker build --no-cache -t garagatyi/che-marketplace:1 --build-arg STORAGE_TYPE=path --build-arg STORAGE_PATH=some_path_in_build_context path_to_build_context
```
78 changes: 21 additions & 57 deletions deploy/kubernetes/kubectl/wsnext/feature-api.yaml
Expand Up @@ -12,80 +12,44 @@ items:
kind: Service
metadata:
labels:
app: feature-api
name: feature-api-service
app: marketplace
name: marketplace
spec:
ports:
- name: feature-api
port: 3000
- name: marketplace
port: 80
protocol: TCP
targetPort: 3000
targetPort: 8080
selector:
app: feature-api
- apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: feature-api
name: feature-api
data:
CHE_REGISTRY_UPDATE_INTERVAL: "60"
CHE_REGISTRY_GITHUB_URL: "https://github.com/garagatyi/che-registry.git"
- apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: feature-api-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600"
spec:
rules:
- host: feature.192.168.99.100.nip.io
http:
paths:
- backend:
serviceName: feature-api-service
servicePort: 3000
app: marketplace
- apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: feature-api
name: feature-api
app: marketplace
name: marketplace
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: feature-api
app: marketplace
strategy:
type: Recreate
template:
metadata:
labels:
app: feature-api
app: marketplace
spec:
containers:
- env:
- name: CHE_REGISTRY_UPDATE_INTERVAL
valueFrom:
configMapKeyRef:
key: CHE_REGISTRY_UPDATE_INTERVAL
name: feature-api
- name: CHE_REGISTRY_GITHUB_URL
valueFrom:
configMapKeyRef:
key: CHE_REGISTRY_GITHUB_URL
name: feature-api
image: garagatyi/kubesrv:latest
imagePullPolicy: Always
name: feature-api
ports:
- containerPort: 3000
name: feature-api
resources:
limits:
memory: 600Mi
requests:
memory: 256Mi
- image: garagatyi/che-marketplace:os
imagePullPolicy: Always
name: marketplace-apache
ports:
- containerPort: 8080
name: marketplace
resources:
limits:
memory: 600Mi
requests:
memory: 256Mi
4 changes: 4 additions & 0 deletions deploy/openshift/templates/README.md
Expand Up @@ -259,3 +259,7 @@ To allow creating workspace OpenShift resources in personal OpenShift accounts,
```


## Workspace.Next

There is a file `../../kubernetes/kubectl/wsnext/feature-api.yaml` which contains apache service that hosts Workspace.Next files. It is needed to test Workspace.Next.
To use it call `oc apply -f ../../kubernetes/kubectl/wsnext/feature-api.yaml` and Che will be able to use Workspace.Next flow.
2 changes: 1 addition & 1 deletion deploy/openshift/templates/che-server-template.yaml
Expand Up @@ -143,7 +143,7 @@ objects:
name: openshift-identity-provider
optional: true
- name: CHE_WORKSPACE_FEATURE_API
value: "http://feature-api-service:3000"
value: "http://marketplace:80"
image: ${IMAGE_CHE}:${CHE_VERSION}
imagePullPolicy: "${PULL_POLICY}"
livenessProbe:
Expand Down
89 changes: 0 additions & 89 deletions deploy/openshift/templates/wsnext/feature-api.yaml

This file was deleted.

0 comments on commit 9fe9021

Please sign in to comment.