Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Che Operator should be able to install the Devworkspace che operator #707

Merged
merged 9 commits into from
Mar 11, 2021
6 changes: 5 additions & 1 deletion .ci/oci-nightly-olm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ runTests() {
waitDevWorkspaceControllerStarted

sleep 10s
createWorksaceDevWorkspaceController
createWorkspaceDevWorkspaceController
waitWorkspaceStartedDevWorkspaceController

sleep 10s
createWorkspaceDevWorkspaceCheOperator
waitWorkspaceStartedDevWorkspaceController
}

Expand Down
8 changes: 6 additions & 2 deletions .github/bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ waitDevWorkspaceControllerStarted() {
exit 1
}

createWorksaceDevWorkspaceController () {
createWorkspaceDevWorkspaceController () {
oc apply -f https://raw.githubusercontent.com/devfile/devworkspace-operator/main/samples/flattened_theia-next.yaml -n ${NAMESPACE}
}

Expand All @@ -390,7 +390,7 @@ waitWorkspaceStartedDevWorkspaceController() {
do
pods=$(oc get pods -n ${NAMESPACE})
if [[ $pods =~ .*Running.* ]]; then
echo "[INFO] Wokrspace started succesfully"
echo "[INFO] Workspace started succesfully"
return
fi

Expand All @@ -401,3 +401,7 @@ waitWorkspaceStartedDevWorkspaceController() {
echo "Failed to start a workspace"
exit 1
}

createWorkspaceDevWorkspaceCheOperator() {
oc apply -f https://raw.githubusercontent.com/che-incubator/devworkspace-che-operator/main/samples/flattened_theia-nodejs.yaml -n ${NAMESPACE}
}
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# NOTE: using registry.redhat.io/rhel8/go-toolset requires login, which complicates automation
# NOTE: since updateBaseImages.sh does not support other registries than RHCC, update to RHEL8
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/devtools/go-toolset-rhel7
ARG DEV_WORKSPACE_CONTROLLER_VERSION="master"
ARG DEV_WORKSPACE_CONTROLLER_VERSION="main"
ARG DEV_WORKSPACE_CHE_OPERATOR_VERSION="main"
tolusha marked this conversation as resolved.
Show resolved Hide resolved

FROM registry.access.redhat.com/devtools/go-toolset-rhel7:1.13.15-4 as builder
ENV PATH=/opt/rh/go-toolset-1.13/root/usr/bin:${PATH} \
Expand All @@ -33,6 +34,10 @@ RUN export ARCH="$(uname -m)" && if [[ ${ARCH} == "x86_64" ]]; then export ARCH=
RUN curl -L https://api.github.com/repos/devfile/devworkspace-operator/zipball/${DEV_WORKSPACE_CONTROLLER_VERSION} > /tmp/devworkspace-operator.zip && \
unzip /tmp/devworkspace-operator.zip */deploy/deployment/* -d /tmp

# download devworkspace-che-operator templates
RUN curl -L https://api.github.com/repos/che-incubator/devworkspace-che-operator/zipball/${DEV_WORKSPACE_CHE_OPERATOR_VERSION} > /tmp/devworkspace-che-operator.zip && \
unzip /tmp/devworkspace-che-operator.zip */deploy/deployment/* -d /tmp


# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8-minimal
FROM registry.access.redhat.com/ubi8-minimal:8.3-291
Expand All @@ -43,6 +48,7 @@ COPY --from=builder /che-operator/templates/oauth-provision.sh /tmp/oauth-provis
COPY --from=builder /che-operator/templates/delete-identity-provider.sh /tmp/delete-identity-provider.sh
COPY --from=builder /che-operator/templates/create-github-identity-provider.sh /tmp/create-github-identity-provider.sh
COPY --from=builder /tmp/devfile-devworkspace-operator-*/deploy /tmp/devworkspace-operator/templates
COPY --from=builder /tmp/che-incubator-devworkspace-che-operator-*/deploy /tmp/devworkspace-che-operator/templates

# apply CVE fixes, if required
RUN microdnf update -y librepo libnghttp2 && microdnf install httpd-tools && microdnf clean all && rm -rf /var/cache/yum && echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages"
Expand Down
71 changes: 71 additions & 0 deletions deploy/cluster_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,74 @@ rules:
verbs:
- list
- watch
# devworkspace-che requirements
- apiGroups:
- che.eclipse.org
resources:
- '*'
verbs:
- '*'
- apiGroups:
- che.eclipse.org
resources:
- chemanagers
verbs:
- '*'
- apiGroups:
- che.eclipse.org
resources:
- chemanagers/status
verbs:
- get
- patch
- update
- apiGroups:
- che.eclipse.org
resources:
- chemanagers/finalizers
verbs:
- update
tolusha marked this conversation as resolved.
Show resolved Hide resolved
- apiGroups:
- controller.devfile.io
resources:
- workspaceroutings
verbs:
- '*'
- apiGroups:
- controller.devfile.io
resources:
- workspaceroutings/finalizers
verbs:
- update
- apiGroups:
- controller.devfile.io
resources:
- workspaceroutings/status
verbs:
- get
- patch
- update
- apiGroups:
- ''
resources:
- configmap
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- deployments/finalizers
resourceNames:
- devworkspace-che-operator
verbs:
- update
- nonResourceURLs:
- /metrics
verbs:
- get
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ metadata:
categories: Developer Tools
certified: "false"
containerImage: quay.io/eclipse/che-operator:nightly
createdAt: "2021-03-05T16:30:06Z"
createdAt: "2021-03-10T11:28:00Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces.
operatorframework.io/suggested-namespace: eclipse-che
repository: https://github.com/eclipse/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-kubernetes.v7.27.0-122.nightly
name: eclipse-che-preview-kubernetes.v7.28.0-124.nightly
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -461,6 +461,76 @@ spec:
verbs:
- list
- watch
- apiGroups:
- che.eclipse.org
resources:
- '*'
verbs:
- '*'
- apiGroups:
- che.eclipse.org
resources:
- chemanagers
verbs:
- '*'
- apiGroups:
- che.eclipse.org
resources:
- chemanagers/status
verbs:
- get
- patch
- update
- apiGroups:
- che.eclipse.org
resources:
- chemanagers/finalizers
verbs:
- update
- apiGroups:
- controller.devfile.io
resources:
- workspaceroutings
verbs:
- '*'
- apiGroups:
- controller.devfile.io
resources:
- workspaceroutings/finalizers
verbs:
- update
- apiGroups:
- controller.devfile.io
resources:
- workspaceroutings/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- configmap
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resourceNames:
- devworkspace-che-operator
resources:
- deployments/finalizers
verbs:
- update
- nonResourceURLs:
- /metrics
verbs:
- get
serviceAccountName: che-operator
- rules:
- apiGroups:
Expand Down Expand Up @@ -719,4 +789,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.27.0-122.nightly
version: 7.28.0-124.nightly
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ metadata:
categories: Developer Tools, OpenShift Optional
certified: "false"
containerImage: quay.io/eclipse/che-operator:nightly
createdAt: "2021-03-05T16:30:13Z"
createdAt: "2021-03-10T11:28:09Z"
description: A Kube-native development solution that delivers portable and collaborative
developer workspaces in OpenShift.
operatorframework.io/suggested-namespace: eclipse-che
repository: https://github.com/eclipse/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-openshift.v7.27.0-112.nightly
name: eclipse-che-preview-openshift.v7.28.0-114.nightly
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -534,6 +534,76 @@ spec:
verbs:
- list
- watch
- apiGroups:
- che.eclipse.org
resources:
- '*'
verbs:
- '*'
- apiGroups:
- che.eclipse.org
resources:
- chemanagers
verbs:
- '*'
- apiGroups:
- che.eclipse.org
resources:
- chemanagers/status
verbs:
- get
- patch
- update
- apiGroups:
- che.eclipse.org
resources:
- chemanagers/finalizers
verbs:
- update
- apiGroups:
- controller.devfile.io
resources:
- workspaceroutings
verbs:
- '*'
- apiGroups:
- controller.devfile.io
resources:
- workspaceroutings/finalizers
verbs:
- update
- apiGroups:
- controller.devfile.io
resources:
- workspaceroutings/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- configmap
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resourceNames:
- devworkspace-che-operator
resources:
- deployments/finalizers
verbs:
- update
- nonResourceURLs:
- /metrics
verbs:
- get
serviceAccountName: che-operator
- rules:
- apiGroups:
Expand Down Expand Up @@ -796,4 +866,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.27.0-112.nightly
version: 7.28.0-114.nightly
18 changes: 16 additions & 2 deletions local-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ command -v operator-sdk >/dev/null 2>&1 || { echo "operator-sdk is not installed
ECLIPSE_CHE_NAMESPACE="eclipse-che"
ECLIPSE_CHE_CR="./deploy/crds/org_v1_che_cr.yaml"
ECLIPSE_CHE_CRD="./deploy/crds/org_v1_che_crd.yaml"
DEV_WORKSPACE_CONTROLLER_VERSION="master"
DEV_WORKSPACE_CONTROLLER_VERSION="main"
DEV_WORKSPACE_CHE_OPERATOR_VERSION="main"

# Stop execution on any error
trap "catchFinish" EXIT SIGINT
Expand Down Expand Up @@ -60,9 +61,22 @@ prepareTemplates() {

curl -sL https://api.github.com/repos/devfile/devworkspace-operator/zipball/${DEV_WORKSPACE_CONTROLLER_VERSION} > /tmp/devworkspace-operator.zip

unzip /tmp/devworkspace-operator.zip */deploy/deployment/* -d /tmp
unzip /tmp/devworkspace-operator.zip '*/deploy/deployment/*' -d /tmp
cp -r /tmp/devfile-devworkspace-operator*/deploy/* /tmp/devworkspace-operator/templates
echo "[INFO] Downloading Dev Workspace operator templates completed."

# Download Dev Workspace Che operator templates
echo "[INFO] Downloading Dev Workspace Che operator templates ..."
rm /tmp/devworkspace-che-operator.zip
rm -rf /tmp/che-incubator-devworkspace-che-operator-*
rm -rf /tmp/devworkspace-che-operator/
mkdir -p /tmp/devworkspace-che-operator/templates

curl -sL https://api.github.com/repos/che-incubator/devworkspace-che-operator/zipball/${DEV_WORKSPACE_CHE_OPERATOR_VERSION} > /tmp/devworkspace-che-operator.zip

unzip /tmp/devworkspace-che-operator.zip '*/deploy/deployment/*' -d /tmp
cp -r /tmp/che-incubator-devworkspace-che-operator*/deploy/* /tmp/devworkspace-che-operator/templates
echo "[INFO] Downloading Dev Workspace Che operator templates completed."
}

createNamespace() {
Expand Down
4 changes: 3 additions & 1 deletion make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ init() {
FORCE_UPDATE=""
BUILDX_PLATFORMS="linux/amd64,linux/ppc64le"
DEV_WORKSPACE_CONTROLLER_VERSION="master"
metlos marked this conversation as resolved.
Show resolved Hide resolved
DEV_WORKSPACE_CHE_OPERATOR_VERSION="main"

if [[ $# -lt 1 ]]; then usage; exit; fi

Expand All @@ -41,6 +42,7 @@ init() {
'--update-nightly-olm-files') UPDATE_NIGHTLY_OLM_FILES=true; shift 0;;
'--prepare-community-operators-update') PREPARE_COMMUNITY_OPERATORS_UPDATE=true; shift 0;;
'--dev-workspace-controller-version') DEV_WORKSPACE_CONTROLLER_VERSION=$2; shift 1;;
'--dev-workspace-che-operator-version') DEV_WORKSPACE_CHE_OPERATOR_VERSION=$2; shift 1;;
'--force') FORCE_UPDATE="--force"; shift 0;;
'--help'|'-h') usage; exit;;
esac
Expand Down Expand Up @@ -161,7 +163,7 @@ releaseOperatorCode() {
docker login quay.io -u "${QUAY_ECLIPSE_CHE_USERNAME}" -p "${QUAY_ECLIPSE_CHE_PASSWORD}"

echo "[INFO] releaseOperatorCode :: Build operator image in platforms: $BUILDX_PLATFORMS"
docker buildx build --build-arg DEV_WORKSPACE_CONTROLLER_VERSION=${DEV_WORKSPACE_CONTROLLER_VERSION} --platform "$BUILDX_PLATFORMS" --push -t "quay.io/eclipse/che-operator:${RELEASE}" .
docker buildx build --build-arg DEV_WORKSPACE_CONTROLLER_VERSION=${DEV_WORKSPACE_CONTROLLER_VERSION} --build-arg DEV_WORKSPACE_CHE_OPERATOR_VERSION=${DEV_WORKSPACE_CHE_OPERATOR_VERSION} --platform "$BUILDX_PLATFORMS" --push -t "quay.io/eclipse/che-operator:${RELEASE}" .
}

updateNightlyOlmFiles() {
Expand Down
Loading