Skip to content

Commit

Permalink
Simpler Helm Chart store (#467)
Browse files Browse the repository at this point in the history
* Update go.sum

* Replace foundation DB with sql db and file cache

* Tidy ups and final tweaks to get versions working

* Tidy up build and remove fdb

* Update .gitignore

* Remove unused functions

* FIx upgrade and add in sources

* Fix unit test

* Remove fdb helm chart values

* Fix default cache folder name

* Remove unused commented code

* Fix comments

* Formatting

* Tidy ups

* Add missing import following refactor

* Fix issues with async delete and edit

* Tidy up chartName

* Fix HelmChartID rename to HelmChartReference

* FIx backend merge issues

* Set volume for helm cache when deployed to k8s

* Fix fro kuberenetes deployment

* Ensure db statements aer modified for different DBs

* Address PR feedback

* Fix missing param to error log msg

* Add support for retrieving icon for a specific version

* Use icon for the chart version. Reduce loading indicators

* Bug fix for icon on list view

* Fix icons on Helm Hub

* Address final PR feedback
  • Loading branch information
nwmac authored Sep 14, 2020
1 parent 2122aae commit e568f98
Show file tree
Hide file tree
Showing 103 changed files with 1,585 additions and 7,559 deletions.
1 change: 1 addition & 0 deletions .cfignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ docs/
build/dev_config.json
e2e-reports/
website/
.helm-cache/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ src/jetstream/config.properties
src/jetstream/db/dbconf.yml
src/jetstream/plugins/monocular/chart-repo/chartrepo
src/jetstream/plugins/analysis/container/analyzers
src/jetstream/.helm-cache

# Customisations - these can be removed in the future
# Left in for now to prevent these files being checked-in, if they are still present
Expand Down
105 changes: 1 addition & 104 deletions deploy/Dockerfile.all-in-one
Original file line number Diff line number Diff line change
Expand Up @@ -16,65 +16,6 @@ RUN deploy/all-in-one/src-build.sh
# Generate dev-certs
RUN CERTS_PATH=/home/stratos/dev-certs ./generate_cert.sh

# ---------------------------------------------------------------------------------------------------
# Docker build for FDB Server component
FROM splatform/stratos-bk-build-base:leap15_1 as fdbserver-builder

# Install FoundationDB Binaries
ARG FDB_VERSION=6.2.15
ARG FDB_WEBSITE=https://www.foundationdb.org

USER root
WORKDIR /home/stratos/tmp
WORKDIR /home/stratos
RUN pwd && ls -al
RUN curl $FDB_WEBSITE/downloads/$FDB_VERSION/linux/fdb_$FDB_VERSION.tar.gz -o fdb_$FDB_VERSION.tar.gz && \
tar -xzf fdb_$FDB_VERSION.tar.gz --strip-components=1 && \
rm fdb_$FDB_VERSION.tar.gz && \
chmod u+x fdbbackup fdbcli fdbdr fdbmonitor fdbrestore fdbserver backup_agent dr_agent && \
mv fdbbackup fdbcli fdbdr fdbmonitor fdbrestore fdbserver backup_agent dr_agent /usr/bin

WORKDIR /var/fdb

# Install FoundationDB Client Libraries

ARG FDB_VERSION=6.2.15
ARG FDB_ADDITIONAL_VERSIONS="5.1.7"
ARG FDB_WEBSITE=https://www.foundationdb.org

COPY deploy/containers/monocular/fdb-server/download_multiversion_libraries.bash scripts/

# Set Up Runtime Scripts and Directories
COPY deploy/containers/monocular/fdb-server/fdb.bash scripts/
COPY deploy/containers/monocular/fdb-server/create_server_environment.bash scripts/
COPY deploy/containers/monocular/fdb-server/create_cluster_file.bash scripts/
COPY deploy/containers/monocular/fdb-server/configure_db.bash scripts/
RUN chmod u+x scripts/*.bash && \
mkdir -p logs

# ---------------------------------------------------------------------------------------------------
# Docker build for FDB Document Layer component
FROM splatform/stratos-bk-build-base:leap15_1 as fdbdoclayer-builder

# Install FoundationDB Document Layer Binaries
ARG FDB_DOC_VERSION=1.6.3
ARG FDB_WEBSITE=https://www.foundationdb.org

WORKDIR /home/stratos
RUN curl $FDB_WEBSITE/downloads/$FDB_DOC_VERSION/linux/fdb-document-layer-$FDB_DOC_VERSION-Linux.tar.gz -o fdb-document-layer-$FDB_DOC_VERSION-Linux.tar.gz && \
tar -xvf fdb-document-layer-$FDB_DOC_VERSION-Linux.tar.gz && \
mv fdb-document-layer-$FDB_DOC_VERSION-Linux doclayer

# ---------------------------------------------------------------------------------------------------
# Docker build for Chart Repo component
FROM splatform/stratos-bk-build-base:leap15_1 as chartrepo-builder

COPY --chown=stratos:users src/jetstream/plugins/monocular/chart-repo /go/src/github.com/helm/monocular
WORKDIR /go/src/github.com/helm/monocular
ARG VERSION
RUN GO111MODULE=on GOPROXY=https://gocenter.io CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-X main.version=$VERSION" .


# ---------------------------------------------------------------------------------------------------
# Final AIO Container
# ---------------------------------------------------------------------------------------------------
Expand All @@ -92,59 +33,15 @@ COPY --from=jetstream-builder /home/stratos/config.properties /srv/config.proper
# User Invite templates
COPY --from=jetstream-builder /home/stratos/src/jetstream/templates /srv/templates

# Pull in binaries from fdbserver-builder
COPY --from=fdbserver-builder /usr/bin /usr/bin
COPY --from=fdbserver-builder /var/fdb/scripts /var/fdb/scripts

# Install FoundationDB Client Libraries directly here rather than in the fdbserver-builder, as the install destination depends on an external script.
ARG FDB_VERSION=6.2.15
ARG FDB_ADDITIONAL_VERSIONS="5.1.7"
ARG FDB_WEBSITE=https://www.foundationdb.org
RUN mkdir -p /mnt/website
RUN curl $FDB_WEBSITE/downloads/$FDB_VERSION/linux/libfdb_c_$FDB_VERSION.so -o /usr/lib64/libfdb_c.so && \
bash /var/fdb/scripts/download_multiversion_libraries.bash $FDB_WEBSITE $FDB_ADDITIONAL_VERSIONS && \
rm -rf /mnt/website
VOLUME /var/fdb/data
RUN mkdir -p /var/fdb/logs

# Pull in binaries from fdbdoclayer-builder
COPY --from=fdbdoclayer-builder /home/stratos/doclayer/bin/fdbdoc /usr/bin/fdbdoc
COPY --from=fdbdoclayer-builder /home/stratos/doclayer/lib/foundationdb/document/fdbmonitor /usr/bin/fdbmonitor
# Bring in doclayer startup script
COPY deploy/containers/monocular/fdb-doclayer/fdbdoc.bash /var/fdb/scripts
RUN chmod u+x /var/fdb/scripts/fdbdoc.bash
# Doclayer startup script dependency
# FoundationDB environment variables
ENV FDB_PORT 4500
ENV FDB_CLUSTER_FILE /var/fdb/fdb.cluster
# Set to host, since all processes run in single container
ENV FDB_NETWORKING_MODE host
ENV FDB_COORDINATOR_PORT 4500
ENV FDB_PROCESS_CLASS unset
ENV CLUSTER_ID docker:docker
ENV FDB_COORDINATOR localhost
ENV FDB_DOC_PORT 27016
ENV FDB_LISTEN_IP 0.0.0.0

# Pull in binaries from chartrepo-builder
COPY --from=chartrepo-builder /go/src/github.com/helm/monocular/chartrepo /chartrepo

# Enable persistence features if canary build flag is set
RUN if [ "x$CANARY_BUILD" != "x" ] ; then printf "\nFORCE_ENABLE_PERSISTENCE_FEATURES=true\n" >> /srv/config.properties ; fi

# Enable tech preview features if canary build flag is set
RUN if [ "x$CANARY_BUILD" != "x" ] ; then printf "\nENABLE_TECH_PREVIEW=true\n" >> /srv/config.properties ; fi

# Fix dig to resolve localhost to 127.0.0.1
RUN mv /usr/bin/dig /usr/bin/digit
COPY deploy/all-in-one/dig.sh /usr/bin/dig
RUN chmod +x /usr/bin/dig

EXPOSE 443

# Need to be root to bind to port 443
USER root

COPY deploy/aio-entrypoint.sh .
RUN chmod +x ./aio-entrypoint.sh
ENTRYPOINT ["bash", "-c", "./aio-entrypoint.sh -u mongodb://localhost:${FDB_DOC_PORT}"]
ENTRYPOINT ["./jetstream"]
26 changes: 0 additions & 26 deletions deploy/aio-entrypoint.sh

This file was deleted.

3 changes: 1 addition & 2 deletions deploy/all-in-one/config.all-in-one.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ STRATOS_DEPLOYMENT_DOCKER_AIO=true
SKIP_SSL_VALIDATION=true
SQLITE_KEEP_DB=true
TEMPLATE_DIR=./templates
FDB_URL=mongodb://localhost:27016
SYNC_SERVER_URL=http://localhost:8080
HELM_CACHE_FOLDER=./helm-cache
8 changes: 0 additions & 8 deletions deploy/all-in-one/dig.sh

This file was deleted.

51 changes: 6 additions & 45 deletions deploy/ci/suse-console-dev-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,6 @@ resources:
username: ((docker-username))
password: ((docker-password))
repository: ((docker-repository))/stratos-console
- name: fdbserver-image
type: docker-image
source:
username: ((docker-username))
password: ((docker-password))
repository: ((docker-repository))/stratos-fdbserver
- name: fdbdoclayer-image
type: docker-image
source:
username: ((docker-username))
password: ((docker-password))
repository: ((docker-repository))/stratos-fdbdoclayer
- name: chartsync-image
type: docker-image
source:
username: ((docker-username))
password: ((docker-password))
repository: ((docker-repository))/stratos-chartsync
- name: kube-terminal-image
type: docker-image
source:
Expand Down Expand Up @@ -159,13 +141,6 @@ jobs:
tag: image-tag/v2-alpha-tag
patch_base_reg: ((patch-base-reg))
patch_base_tag: ((patch-base-tag))
- put: kube-terminal-image
params:
dockerfile: stratos/deploy/containers/kube-terminal/Dockerfile.kubeterminal
build: stratos/deploy/containers/kube-terminal
tag: image-tag/v2-alpha-tag
patch_base_reg: ((patch-base-reg))
patch_base_tag: ((patch-base-tag))
- do:
- put: ui-image
params:
Expand All @@ -184,31 +159,17 @@ jobs:
patch_base_reg: ((patch-base-reg))
patch_base_tag: ((patch-base-tag))
- do:
- put: fdbserver-image
params:
dockerfile: stratos/deploy/containers/monocular/fdb-server/Dockerfile
build: stratos/deploy/containers/monocular/fdb-server/
tag: image-tag/v2-alpha-tag
patch_base_reg: ((patch-base-reg))
patch_base_tag: ((patch-base-tag))
- put: fdbdoclayer-image
params:
dockerfile: stratos/deploy/containers/monocular/fdb-doclayer/Dockerfile
build: stratos/deploy/containers/monocular/fdb-doclayer/
tag: image-tag/v2-alpha-tag
patch_base_reg: ((patch-base-reg))
patch_base_tag: ((patch-base-tag))
- put: chartsync-image
- put: analyzers-image
params:
dockerfile: stratos/src/jetstream/plugins/monocular/chart-repo/Dockerfile
build: stratos/src/jetstream/plugins/monocular/chart-repo/
dockerfile: stratos/src/jetstream/plugins/analysis/container/Dockerfile
build: stratos/src/jetstream/plugins/analysis/container/
tag: image-tag/v2-alpha-tag
patch_base_reg: ((patch-base-reg))
patch_base_tag: ((patch-base-tag))
- put: analyzers-image
- put: kube-terminal-image
params:
dockerfile: stratos/src/jetstream/plugins/analysis/container/Dockerfile
build: stratos/src/jetstream/plugins/analysis/container/
dockerfile: stratos/deploy/containers/kube-terminal/Dockerfile.kubeterminal
build: stratos/deploy/containers/kube-terminal
tag: image-tag/v2-alpha-tag
patch_base_reg: ((patch-base-reg))
patch_base_tag: ((patch-base-tag))
Expand Down
4 changes: 3 additions & 1 deletion deploy/cloud-foundry/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ ENCRYPTION_KEY=B374A26A71490437AA024E4FADD5B497FDFF1A8EA6FF12F6FB65AF2720B59CCF
#VCAP_APPLICATION={"cf_api": "https://api.10.4.21.240.nip.io:8443"}

# User invite templates
TEMPLATE_DIR=./templates
TEMPLATE_DIR=./templates

HELM_CACHE_FOLDER=./helm-cache
64 changes: 0 additions & 64 deletions deploy/containers/monocular/fdb-doclayer/Dockerfile

This file was deleted.

This file was deleted.

Loading

0 comments on commit e568f98

Please sign in to comment.