Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ RUN git clone https://github.com/devfile/registry-support.git /registry-support
# Run the registry build tools
RUN /registry-support/build-tools/build.sh /registry /build

FROM quay.io/devfile/devfile-index-base:f16affcff745d534d19bc73d63e12bf8e2bf4d04
FROM quay.io/devfile/devfile-index-base:next

COPY --from=builder /build /registry
33 changes: 27 additions & 6 deletions .ci/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,40 @@
set -ex
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
GIT_REV="$(git rev-parse --short=7 HEAD)"
IMAGE="${IMAGE:-quay.io/app-sre/devfile-index}"
INDEX_IMAGE="${INDEX_IMAGE:-quay.io/app-sre/devfile-index}"
VIEWER_IMAGE="${VIEWER_IMAGE:-quay.io/app-sre/registry-viewer}"
IMAGE_TAG="${IMAGE_TAG:-${GIT_REV}}"

# Run the build script
$ABSOLUTE_PATH/build.sh

# Push the iamge to quay.io
# Clone devfile-web for building registry-viewer
if [ -d $ABSOLUTE_PATH/devfile-web ]
then
rm -rf $ABSOLUTE_PATH/devfile-web
fi
git clone https://github.com/devfile/devfile-web.git $ABSOLUTE_PATH/devfile-web

# Build registry-viewer
bash $ABSOLUTE_PATH/devfile-web/scripts/build_viewer.sh

# Push the image to quay.io
if [[ -n "$QUAY_USER" && -n "$QUAY_TOKEN" ]]; then
DOCKER_CONF="$PWD/.docker"
mkdir -p "$DOCKER_CONF"
docker tag devfile-index "${IMAGE}:${IMAGE_TAG}"
docker tag devfile-index "${IMAGE}:next"

# login into quay.io
docker --config="$DOCKER_CONF" login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io
docker --config="$DOCKER_CONF" push "${IMAGE}:${IMAGE_TAG}"
docker --config="$DOCKER_CONF" push "${IMAGE}:next"

# devfile-index
docker tag devfile-index "${INDEX_IMAGE}:${IMAGE_TAG}"
docker tag devfile-index "${INDEX_IMAGE}:next"
docker --config="$DOCKER_CONF" push "${INDEX_IMAGE}:${IMAGE_TAG}"
docker --config="$DOCKER_CONF" push "${INDEX_IMAGE}:next"

# registry-viewer
docker tag registry-viewer "${VIEWER_IMAGE}:${IMAGE_TAG}"
docker tag registry-viewer "${VIEWER_IMAGE}:next"
docker --config="$DOCKER_CONF" push "${VIEWER_IMAGE}:${IMAGE_TAG}"
docker --config="$DOCKER_CONF" push "${VIEWER_IMAGE}:next"
fi
97 changes: 67 additions & 30 deletions .ci/deploy/devfile-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ objects:
items:
- key: registry-config.yml
path: config.yml
- name: viewer-config
- name: viewer-env-file
configMap:
name: devfile-registry
items:
- key: devfile-registry-hosts.json
path: devfile-registry-hosts.json
- key: .env.registry-viewer
path: .env.local
containers:
- image: ${DEVFILE_INDEX_IMAGE}:${IMAGE_TAG}
imagePullPolicy: "${DEVFILE_INDEX_PULL_POLICY}"
Expand Down Expand Up @@ -84,14 +84,6 @@ objects:
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 3
startupProbe:
httpGet:
path: /viewer
port: 8080
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 10
resources:
requests:
cpu: 100m
Expand All @@ -100,20 +92,60 @@ objects:
cpu: 250m
memory: ${DEVFILE_INDEX_MEMORY_LIMIT}
env:
- name: DEVFILE_VIEWER_ROOT
value: "/viewer"
- name: ENABLE_TELEMETRY
value: ${ENABLE_TELEMETRY}
- name: REGISTRY_NAME
value: ${REGISTRY_NAME}
- name: ANALYTICS_WRITE_KEY
value: ${ANALYTICS_WRITE_KEY}
- name: TELEMETRY_KEY
value: ${TELEMETRY_KEY}
- image: ${REGISTRY_VIEWER_IMAGE}:${IMAGE_TAG}
imagePullPolicy: "${REGISTRY_VIEWER_PULL_POLICY}"
name: devfile-registry-viewer
ports:
- containerPort: 3000
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop: ["ALL"]
seccompProfile:
type: "RuntimeDefault"
livenessProbe:
httpGet:
path: /viewer
port: 3000
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /viewer
port: 3000
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 3
startupProbe:
httpGet:
path: /viewer
port: 3000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 10
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 250m
memory: ${REGISTRY_VIEWER_MEMORY_LIMIT}
volumeMounts:
- name: viewer-config
mountPath: "/app/config"
readOnly: false
- name: viewer-env-file
mountPath: /app/apps/registry-viewer/.env.local
subPath: .env.local
readOnly: true
- image: ${OCI_REGISTRY_IMAGE}:${OCI_REGISTRY_IMAGE_TAG}
imagePullPolicy: "${OCI_REGISTRY_PULL_POLICY}"
name: oci-registry
Expand Down Expand Up @@ -201,13 +233,10 @@ objects:
enabled: true
path: /metrics

devfile-registry-hosts.json: |
{
"Community": {
"url": "http://localhost:8080",
"alias": "${REGISTRY_HOST_ALIAS}"
}
}
.env.registry-viewer: |
ANALYTICS_WRITE_KEY=${ANALYTICS_WRITE_KEY}
DEVFILE_REGISTRIES=[{"name":"Community","url":"http://localhost:8080","fqdn":"${REGISTRY_HOST_ALIAS}"}]

- apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -219,10 +248,10 @@ parameters:
value: quay.io/devfile/devfile-index
displayName: Devfile registry index image
description: Devfile registry index docker image. Defaults to quay.io/devfile/devfile-index
- name: DEVFILE_INDEX_IMAGE_TAG
value: next
displayName: Devfile registry version
description: Devfile registry version which defaults to next
- name: REGISTRY_VIEWER_IMAGE
value: quay.io/devfile/registry-viewer
displayName: Devfile registry viewer image
description: Devfile registry viewer docker image. Defaults to quay.io/devfile/registry-viewer
- name: IMAGE_TAG
value: next
displayName: Devfile registry version
Expand All @@ -235,6 +264,14 @@ parameters:
value: Always
displayName: Devfile registry image pull policy
description: Always pull by default. Can be IfNotPresent
- name: REGISTRY_VIEWER_MEMORY_LIMIT
value: 256Mi
displayName: Memory Limit
description: Maximum amount of memory the registry viewer container can use. Defaults 256Mi
- name: REGISTRY_VIEWER_PULL_POLICY
value: Always
displayName: Devfile registry viewer image pull policy
description: Always pull by default. Can be IfNotPresent
- name: OCI_REGISTRY_IMAGE
value: quay.io/devfile/oci-registry
displayName: OCI registry index image
Expand All @@ -249,7 +286,7 @@ parameters:
description: Maximum amount of memory the OCI registry container can use. Defaults 256Mi
- name: OCI_REGISTRY_PULL_POLICY
value: Always
displayName: Devfile registry image pull policy
displayName: OCI registry image pull policy
description: Always pull by default. Can be IfNotPresent
- name: REPLICAS
value: "1"
Expand Down
2 changes: 1 addition & 1 deletion .ci/openshift_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ curl -sL https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift
export GLOBALODOCONFIG=$(pwd)/preferences.yaml

# Install the devfile registry
oc process -f .ci/deploy/devfile-registry.yaml -p DEVFILE_INDEX_IMAGE=$IMG -p IMAGE_TAG=$TAG -p REPLICAS=3 | \
oc process -f .ci/deploy/devfile-registry.yaml -p DEVFILE_INDEX_IMAGE=$IMG -p IMAGE_TAG=$TAG -p REPLICAS=3 -p ANALYTICS_WRITE_KEY= | \
oc apply -f -

# Deploy the routes for the registry
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
index-generator
registry-support/
.idea/
devfile-web/