From a83b7f64a08b2ad5c10dcf8807ab39dfcf6d714d Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 11:20:20 -0500 Subject: [PATCH 01/38] tests if docker gets built in gitlab --- .gitlab/.gitlab-ci.yml | 21 +++++++++++++++- .gitlab/Dockerfile | 56 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .gitlab/Dockerfile diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 0e41bfd1e..cbb7eeffb 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -3,6 +3,9 @@ include: - template: Security/License-Scanning.gitlab-ci.yml - template: Security/Dependency-Scanning.gitlab-ci.yml +variables: + GO_VERSION: 1.16.3 + stages: - test - build @@ -121,4 +124,20 @@ build for darwin arm64: - go build -o featurebase_darwin_arm64 ./cmd/featurebase artifacts: paths: - - featurebase_darwin_arm64 \ No newline at end of file + - featurebase_darwin_arm64 + +# Build a Docker image with CI/CD and push to the GitLab registry. +build container fb: + image: docker:latest + stage: build + services: + - docker:dind + script: + - | + docker build + --build-arg GO_VERSION=$(GO_VERSION) + --tag featurebase:$(VERSION) . + - docker push "$CI_REGISTRY_IMAGE${tag}" + - @echo Created docker image: featurebase:$(VERSION) + + diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile new file mode 100644 index 000000000..115855034 --- /dev/null +++ b/.gitlab/Dockerfile @@ -0,0 +1,56 @@ +ARG GO_VERSION=latest + +####################### +### Lattice builder ### +####################### + +FROM moleculacorp/nodejs:latest as lattice-builder +WORKDIR /lattice + +COPY lattice/package.json ./ +COPY lattice/yarn.lock ./ +RUN yarn install + +COPY lattice ./ +RUN yarn build + +###################### +### Pilosa builder ### +###################### + +FROM golang:${GO_VERSION} as pilosa-builder +ARG MAKE_FLAGS +WORKDIR /pilosa + +RUN go get github.com/rakyll/statik + +COPY . ./ +COPY --from=lattice-builder /lattice/build /lattice +RUN /go/bin/statik -src=/lattice -dest=/pilosa + +RUN make build FLAGS="-o build/featurebase" ${MAKE_FLAGS} + +##################### +### Pilosa runner ### +##################### + +FROM alpine:3.13.2 as runner + +LABEL maintainer "dev@molecula.com" + +RUN apk add --no-cache curl jq + +COPY --from=pilosa-builder /pilosa/build/featurebase / + +COPY LICENSE /LICENSE +COPY NOTICE /NOTICE + +EXPOSE 10101 +VOLUME /data + +ENV PILOSA_DATA_DIR /data +ENV PILOSA_BIND 0.0.0.0:10101 +ENV PILOSA_BIND_GRPC 0.0.0.0:20101 + +ENTRYPOINT ["/featurebase"] +CMD ["server"] From aa0d5040e542eeac9691887cdbd7e4ee89ab57dc Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 12:21:05 -0500 Subject: [PATCH 02/38] remove @ from yaml --- .gitlab/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index cbb7eeffb..c4142bbbe 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -138,6 +138,6 @@ build container fb: --build-arg GO_VERSION=$(GO_VERSION) --tag featurebase:$(VERSION) . - docker push "$CI_REGISTRY_IMAGE${tag}" - - @echo Created docker image: featurebase:$(VERSION) + - echo Created docker image: featurebase:$(VERSION) From e2f3a645c169b6ca6992fe9d2ff1f0d37cef5782 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 12:28:26 -0500 Subject: [PATCH 03/38] try to fix yml syntax --- .gitlab/.gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index c4142bbbe..5797b8978 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -133,8 +133,7 @@ build container fb: services: - docker:dind script: - - | - docker build + - docker build --build-arg GO_VERSION=$(GO_VERSION) --tag featurebase:$(VERSION) . - docker push "$CI_REGISTRY_IMAGE${tag}" From 9e2992424de0e9d94c291d99bf0cd8e326bdfa44 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 12:41:38 -0500 Subject: [PATCH 04/38] same --- .gitlab/.gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 5797b8978..b7ad25eaa 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -133,9 +133,7 @@ build container fb: services: - docker:dind script: - - docker build - --build-arg GO_VERSION=$(GO_VERSION) - --tag featurebase:$(VERSION) . + - docker build --build-arg GO_VERSION=$(GO_VERSION) --tag featurebase:$(VERSION) . - docker push "$CI_REGISTRY_IMAGE${tag}" - echo Created docker image: featurebase:$(VERSION) From 86c45fba1c2a02d0ee80289ccefdc7085993508f Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 12:49:49 -0500 Subject: [PATCH 05/38] same --- .gitlab/.gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index b7ad25eaa..6286e7b27 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -133,8 +133,8 @@ build container fb: services: - docker:dind script: - - docker build --build-arg GO_VERSION=$(GO_VERSION) --tag featurebase:$(VERSION) . + - docker build --build-arg GO_VERSION=$(GO_VERSION) --tag featurebase:test . - docker push "$CI_REGISTRY_IMAGE${tag}" - - echo Created docker image: featurebase:$(VERSION) + - echo 'Created docker image featurebase:test' From 93a5cab3fcdbf8a85c33bbb309caa8769b30bce8 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 13:05:14 -0500 Subject: [PATCH 06/38] same --- .gitlab/.gitlab-ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 6286e7b27..e1b4d9048 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -133,7 +133,15 @@ build container fb: services: - docker:dind script: - - docker build --build-arg GO_VERSION=$(GO_VERSION) --tag featurebase:test . + - | + if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then + tag="" + echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'" + else + tag=":$CI_COMMIT_REF_SLUG" + echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" + fi + - docker build --build-arg GO_VERSION=$GO_VERSION -t "$CI_REGISTRY_IMAGE${tag}" . - docker push "$CI_REGISTRY_IMAGE${tag}" - echo 'Created docker image featurebase:test' From 35dc4aa07a7286ee3cae5f3481134700c22ee10c Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 13:47:29 -0500 Subject: [PATCH 07/38] same2 --- .gitlab/.gitlab-ci.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index e1b4d9048..23d1ef7a5 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -4,7 +4,7 @@ include: - template: Security/Dependency-Scanning.gitlab-ci.yml variables: - GO_VERSION: 1.16.3 + GOVERSION: 1.16.3 stages: - test @@ -133,16 +133,9 @@ build container fb: services: - docker:dind script: - - | - if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then - tag="" - echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'" - else - tag=":$CI_COMMIT_REF_SLUG" - echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" - fi - - docker build --build-arg GO_VERSION=$GO_VERSION -t "$CI_REGISTRY_IMAGE${tag}" . - - docker push "$CI_REGISTRY_IMAGE${tag}" - - echo 'Created docker image featurebase:test' + - tag = "'$CI_REGISTRY_IMAGE':'$CI_COMMIT_SHORT_SHA'" + - docker build --build-arg GO_VERSION=$GOVERSION -t "$tag" . + - docker push "$tag" + - echo "Created docker featurebase image with tag '$tag'" From bde29ec792a85a6cec82cebb1ea0abcd1a4b3305 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 14:01:05 -0500 Subject: [PATCH 08/38] same3 --- .gitlab/.gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 23d1ef7a5..63865b1da 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -133,9 +133,9 @@ build container fb: services: - docker:dind script: - - tag = "'$CI_REGISTRY_IMAGE':'$CI_COMMIT_SHORT_SHA'" - - docker build --build-arg GO_VERSION=$GOVERSION -t "$tag" . - - docker push "$tag" - - echo "Created docker featurebase image with tag '$tag'" + - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA + - docker build --build-arg GO_VERSION=$GOVERSION -t $tag . + - docker push $tag + - echo Created docker featurebase image with tag "$tag" From 5b0244e228b84403b59118c00294e41ce8930837 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 14:15:07 -0500 Subject: [PATCH 09/38] same4 --- .gitlab/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 63865b1da..e71c3e200 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -4,7 +4,7 @@ include: - template: Security/Dependency-Scanning.gitlab-ci.yml variables: - GOVERSION: 1.16.3 + GOVERSION: "1.16.3" stages: - test From 554d3f1e356585e7f87931e5a5170e08f2db188f Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 14:34:24 -0500 Subject: [PATCH 10/38] same5 --- .gitlab/.gitlab-ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index e71c3e200..ab5a5c5bf 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -128,10 +128,16 @@ build for darwin arm64: # Build a Docker image with CI/CD and push to the GitLab registry. build container fb: - image: docker:latest + image: docker:stable stage: build services: - docker:dind + variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 + before_script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker info script: - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag . From 225b4a7a584d1f1be572e3c48931653e828cd22e Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 15:17:23 -0500 Subject: [PATCH 11/38] try with shell runner instead of dind --- .gitlab/.gitlab-ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index ab5a5c5bf..f8deb9dc1 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -130,13 +130,9 @@ build for darwin arm64: build container fb: image: docker:stable stage: build - services: - - docker:dind - variables: - DOCKER_HOST: tcp://docker:2375/ - DOCKER_DRIVER: overlay2 + tags: + - shell before_script: - - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker info script: - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA From 686f3a868467e4499551009c53efec2569405b9a Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:23:20 -0500 Subject: [PATCH 12/38] remove lattice from dockerfile --- .gitlab/Dockerfile | 46 +++++++--------------------------------------- 1 file changed, 7 insertions(+), 39 deletions(-) diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index 115855034..81a8f989a 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -1,50 +1,18 @@ -ARG GO_VERSION=latest - -####################### -### Lattice builder ### -####################### - -FROM moleculacorp/nodejs:latest as lattice-builder -WORKDIR /lattice - -COPY lattice/package.json ./ -COPY lattice/yarn.lock ./ -RUN yarn install - -COPY lattice ./ -RUN yarn build - -###################### -### Pilosa builder ### -###################### - -FROM golang:${GO_VERSION} as pilosa-builder -ARG MAKE_FLAGS -WORKDIR /pilosa - -RUN go get github.com/rakyll/statik - -COPY . ./ -COPY --from=lattice-builder /lattice/build /lattice -RUN /go/bin/statik -src=/lattice -dest=/pilosa - -RUN make build FLAGS="-o build/featurebase" ${MAKE_FLAGS} - -##################### -### Pilosa runner ### -##################### - -FROM alpine:3.13.2 as runner +FROM alpine:3.14.2 LABEL maintainer "dev@molecula.com" +LABEL org.opencontainers.image.authors="dev@molecula.com" RUN apk add --no-cache curl jq -COPY --from=pilosa-builder /pilosa/build/featurebase / - COPY LICENSE /LICENSE COPY NOTICE /NOTICE +ARG SHORT_SHA +COPY .cloudbuild/featurebase_linux_amd64 / + +RUN mv /featurebase_linux_amd64 /featurebase +RUN chmod ugo+x /featurebase EXPOSE 10101 VOLUME /data From 34a04d276e60775085fa933ec11ef998fe5dff9c Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:38:07 -0500 Subject: [PATCH 13/38] change path to bin --- .gitlab/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index 81a8f989a..fda808fa3 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -9,7 +9,7 @@ COPY LICENSE /LICENSE COPY NOTICE /NOTICE ARG SHORT_SHA -COPY .cloudbuild/featurebase_linux_amd64 / +COPY .gitlab/featurebase_linux_amd64 / RUN mv /featurebase_linux_amd64 /featurebase RUN chmod ugo+x /featurebase From dd56bdf645e4a01280d06219138e76584afc29e5 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:50:35 -0500 Subject: [PATCH 14/38] runs after linux arm64 build --- .gitlab/.gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index f8deb9dc1..524ae1fbc 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -130,6 +130,8 @@ build for darwin arm64: build container fb: image: docker:stable stage: build + needs: + - "build for linux arm64" tags: - shell before_script: From 00b6c2ff8aa1b77a962bc85ba7a6d64602438e80 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:59:03 -0500 Subject: [PATCH 15/38] change dockerfile path --- .gitlab/.gitlab-ci.yml | 72 +++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 524ae1fbc..70f941f9c 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -7,7 +7,7 @@ variables: GOVERSION: "1.16.3" stages: - - test + # - test - build install lattice: @@ -90,55 +90,55 @@ build for linux amd64: paths: - featurebase_linux_amd64 -build for linux arm64: - stage: build - image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 - variables: - GOOS: "linux" - GOARCH: "arm64" - script: - - go build -o featurebase_linux_arm64 ./cmd/featurebase - artifacts: - paths: - - featurebase_linux_arm64 +# build for linux arm64: +# stage: build +# image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 +# variables: +# GOOS: "linux" +# GOARCH: "arm64" +# script: +# - go build -o featurebase_linux_arm64 ./cmd/featurebase +# artifacts: +# paths: +# - featurebase_linux_arm64 -build for darwin amd64: - stage: build - image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 - variables: - GOOS: "darwin" - GOARCH: "amd64" - script: - - go build -o featurebase_darwin_amd64 ./cmd/featurebase - artifacts: - paths: - - featurebase_darwin_amd64 +# build for darwin amd64: +# stage: build +# image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 +# variables: +# GOOS: "darwin" +# GOARCH: "amd64" +# script: +# - go build -o featurebase_darwin_amd64 ./cmd/featurebase +# artifacts: +# paths: +# - featurebase_darwin_amd64 -build for darwin arm64: - stage: build - image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 - variables: - GOOS: "darwin" - GOARCH: "arm64" - script: - - go build -o featurebase_darwin_arm64 ./cmd/featurebase - artifacts: - paths: - - featurebase_darwin_arm64 +# build for darwin arm64: +# stage: build +# image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 +# variables: +# GOOS: "darwin" +# GOARCH: "arm64" +# script: +# - go build -o featurebase_darwin_arm64 ./cmd/featurebase +# artifacts: +# paths: +# - featurebase_darwin_arm64 # Build a Docker image with CI/CD and push to the GitLab registry. build container fb: image: docker:stable stage: build needs: - - "build for linux arm64" + - "build for linux amd64" tags: - shell before_script: - docker info script: - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA - - docker build --build-arg GO_VERSION=$GOVERSION -t $tag . + - docker build --build-arg GO_VERSION=$GOVERSION -t $tag .gitlab/Dockerfile - docker push $tag - echo Created docker featurebase image with tag "$tag" From 7b39ab2bbde4435aebe734eea751837e6161259d Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:09:34 -0500 Subject: [PATCH 16/38] same --- .gitlab/.gitlab-ci.yml | 124 ++++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 70f941f9c..0cd7688e0 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -10,73 +10,73 @@ stages: # - test - build -install lattice: - stage: test - image: node:14 - script: - - echo "Installing lattice dependencies..." - - cd lattice - - yarn install +# install lattice: +# stage: test +# image: node:14 +# script: +# - echo "Installing lattice dependencies..." +# - cd lattice +# - yarn install -build lattice: - stage: test - image: node:14 - variables: - CI: "true" - script: - - echo "Building lattice..." - - cd lattice - - yarn build - - tar -czvf lattice.tar.gz lattice/build - artifacts: - paths: - - lattice/lattice.tar.gz - needs: - - job: install lattice - allow_failure: true +# build lattice: +# stage: test +# image: node:14 +# variables: +# CI: "true" +# script: +# - echo "Building lattice..." +# - cd lattice +# - yarn build +# - tar -czvf lattice.tar.gz lattice/build +# artifacts: +# paths: +# - lattice/lattice.tar.gz +# needs: +# - job: install lattice +# allow_failure: true -run go tests: - stage: test - image: golang:1.16.9 - script: - - echo "Running featurebase unit tests..." - - go test -covermode=atomic -coverprofile=coverage.out - artifacts: - paths: - - coverage.out +# run go tests: +# stage: test +# image: golang:1.16.9 +# script: +# - echo "Running featurebase unit tests..." +# - go test -covermode=atomic -coverprofile=coverage.out +# artifacts: +# paths: +# - coverage.out -run go tests with output: - stage: test - image: golang:1.16.9 - script: - - echo "Running featurebase unit tests to capture JSON output..." - - go test -json > test-report.out - artifacts: - paths: - - test-report.out +# run go tests with output: +# stage: test +# image: golang:1.16.9 +# script: +# - echo "Running featurebase unit tests to capture JSON output..." +# - go test -json > test-report.out +# artifacts: +# paths: +# - test-report.out -generate coverage html: - stage: test - image: golang:1.16.9 - script: - - echo "Generating coverage HTML.." - - go tool cover -html coverage.out -o coverage.html - artifacts: - paths: - - coverage.html - needs: - - job: run go tests +# generate coverage html: +# stage: test +# image: golang:1.16.9 +# script: +# - echo "Generating coverage HTML.." +# - go tool cover -html coverage.out -o coverage.html +# artifacts: +# paths: +# - coverage.html +# needs: +# - job: run go tests -upload to sonarcloud: - stage: test - image: sonarsource/sonar-scanner-cli:4.6 - variables: - SONAR_TOKEN: $SONAR_TOKEN - script: - - sonar-scanner -Dsonar.projectKey=molecula_featurebase -Dsonar.organization=molecula -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.go.coverage.reportPaths=coverage.out -Dsonar.go.tests.reportPaths=test-report.out - needs: - - job: run go tests - - job: run go tests with output +# upload to sonarcloud: +# stage: test +# image: sonarsource/sonar-scanner-cli:4.6 +# variables: +# SONAR_TOKEN: $SONAR_TOKEN +# script: +# - sonar-scanner -Dsonar.projectKey=molecula_featurebase -Dsonar.organization=molecula -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.go.coverage.reportPaths=coverage.out -Dsonar.go.tests.reportPaths=test-report.out +# needs: +# - job: run go tests +# - job: run go tests with output build for linux amd64: stage: build From 3fcdc6ff9ebdc76cbac97fdecf35e6d27bc21987 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:11:03 -0500 Subject: [PATCH 17/38] same --- .gitlab/.gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 0cd7688e0..f00c3abd0 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -1,7 +1,7 @@ -include: - - template: Security/SAST.gitlab-ci.yml - - template: Security/License-Scanning.gitlab-ci.yml - - template: Security/Dependency-Scanning.gitlab-ci.yml +# include: +# - template: Security/SAST.gitlab-ci.yml +# - template: Security/License-Scanning.gitlab-ci.yml +# - template: Security/Dependency-Scanning.gitlab-ci.yml variables: GOVERSION: "1.16.3" From 2839ef53c9f6bef9167a722b5a6439d056fc2c41 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:30:13 -0500 Subject: [PATCH 18/38] add dir --- .gitlab/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index f00c3abd0..4c87ac632 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -138,7 +138,7 @@ build container fb: - docker info script: - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA - - docker build --build-arg GO_VERSION=$GOVERSION -t $tag .gitlab/Dockerfile + - docker build --build-arg GO_VERSION=$GOVERSION -t $tag .gitlab/Dockerfile . - docker push $tag - echo Created docker featurebase image with tag "$tag" From adcbc4c801ce9e58419c68a91d37373f1cc74410 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 18:06:30 -0500 Subject: [PATCH 19/38] add -f flag --- .gitlab/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 4c87ac632..17280a5eb 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -138,7 +138,7 @@ build container fb: - docker info script: - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA - - docker build --build-arg GO_VERSION=$GOVERSION -t $tag .gitlab/Dockerfile . + - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - docker push $tag - echo Created docker featurebase image with tag "$tag" From 4ec0f7428a124954a840e654e6e6d16d665e7b2b Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 19:10:25 -0500 Subject: [PATCH 20/38] change dir --- .gitlab/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index fda808fa3..feec45395 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -9,7 +9,7 @@ COPY LICENSE /LICENSE COPY NOTICE /NOTICE ARG SHORT_SHA -COPY .gitlab/featurebase_linux_amd64 / +COPY featurebase_linux_amd64 / RUN mv /featurebase_linux_amd64 /featurebase RUN chmod ugo+x /featurebase From 7cde102944d3c229b47acf3148c15b99af5ef123 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 08:48:02 -0500 Subject: [PATCH 21/38] move binary to gitlab --- .gitlab/.gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 17280a5eb..0c3f01f52 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -137,6 +137,7 @@ build container fb: before_script: - docker info script: + - mv featurebase_linux_amd64 .gitlab/ - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - docker push $tag From 5f152af53a7143418fd149dc5bb554d79fd75897 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 09:17:29 -0500 Subject: [PATCH 22/38] print stuff --- .gitlab/.gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 0c3f01f52..a312706dd 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -137,7 +137,12 @@ build container fb: before_script: - docker info script: + - pwd - mv featurebase_linux_amd64 .gitlab/ + - echo LIST ROOT DIR + - ls . + - echo LIST .gitlab + - ls .gitlab/ - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - docker push $tag From 3aec5fd9de9403a0cd400ebf6f3cabb70897e1ce Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 09:38:42 -0500 Subject: [PATCH 23/38] print more stuff --- .gitlab/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index feec45395..95ba069f4 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -4,6 +4,8 @@ LABEL maintainer "dev@molecula.com" LABEL org.opencontainers.image.authors="dev@molecula.com" RUN apk add --no-cache curl jq +RUN pwd +RUN ls . COPY LICENSE /LICENSE COPY NOTICE /NOTICE From 30fb649126fee033adc94e074cbc491fe5b669f1 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 11:18:42 -0500 Subject: [PATCH 24/38] make directory changes --- .gitlab/Dockerfile | 14 ++-- .gitlab/LICENSE | 202 +++++++++++++++++++++++++++++++++++++++++++++ .gitlab/NOTICE | 120 +++++++++++++++++++++++++++ 3 files changed, 330 insertions(+), 6 deletions(-) create mode 100644 .gitlab/LICENSE create mode 100644 .gitlab/NOTICE diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index 95ba069f4..be6913740 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -3,18 +3,20 @@ FROM alpine:3.14.2 LABEL maintainer "dev@molecula.com" LABEL org.opencontainers.image.authors="dev@molecula.com" +WORKDIR /featurebase + RUN apk add --no-cache curl jq RUN pwd RUN ls . -COPY LICENSE /LICENSE -COPY NOTICE /NOTICE +COPY LICENSE . +COPY NOTICE . +COPY .gitlab/featurebase_linux_amd64 . + ARG SHORT_SHA -COPY featurebase_linux_amd64 / - -RUN mv /featurebase_linux_amd64 /featurebase -RUN chmod ugo+x /featurebase +# RUN mv /featurebase_linux_amd64 /featurebase +RUN chmod ugo+x . EXPOSE 10101 VOLUME /data diff --git a/.gitlab/LICENSE b/.gitlab/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/.gitlab/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/.gitlab/NOTICE b/.gitlab/NOTICE new file mode 100644 index 000000000..594272a27 --- /dev/null +++ b/.gitlab/NOTICE @@ -0,0 +1,120 @@ +Software license +================ + +Copyright (C) 2017-2018 Pilosa Corp. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"). +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Third-party software licenses +============================= + +The file /pilosa/lru/lru.go contains a redistribution of lru +(github.com/golang/groupcache/lru); the license follows: + + Copyright 2013 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +The file /roaring/btree.go contains a modified redistribution of b +(https://github.com/cznic/b); the license follows: + + Copyright (c) 2014 The b Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the names of the authors nor the names of the + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The file /server/tlsconfig.go contains a modified redistribution of bridge +(https://github.com/robustirc/bridge); the license follows: + + Copyright © 2014-2015 The RobustIRC Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of RobustIRC nor the names of contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The files /logger/filewriter.go and /logger/filewriter_test.go contain a modified redistribution of reopen (github.com/client9/reopen); the license follows: + + The MIT License (MIT) + + Copyright (c) 2015 Nick Galbreath + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. From 7e1b629504a9a4ccbd3fcc1c5e488385289e85a7 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 11:33:34 -0500 Subject: [PATCH 25/38] change docker push url --- .gitlab/.gitlab-ci.yml | 2 +- .gitlab/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index a312706dd..2de4ea4e2 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -145,7 +145,7 @@ build container fb: - ls .gitlab/ - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - - docker push $tag + - docker push registry.gitlab.com/molecula/featurebase:$tag - echo Created docker featurebase image with tag "$tag" diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index be6913740..8b6516c80 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -25,4 +25,4 @@ ENV PILOSA_BIND 0.0.0.0:10101 ENV PILOSA_BIND_GRPC 0.0.0.0:20101 ENTRYPOINT ["/featurebase"] -CMD ["server"] +CMD ["server"] \ No newline at end of file From 841e79f343dcd246d54555fde293f71dd046ddac Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 11:51:26 -0500 Subject: [PATCH 26/38] same --- .gitlab/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 2de4ea4e2..e5ceabaf8 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -145,7 +145,7 @@ build container fb: - ls .gitlab/ - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - - docker push registry.gitlab.com/molecula/featurebase:$tag + - docker push registry.gitlab.com/molecula/featurebase:$CI_COMMIT_SHORT_SHA - echo Created docker featurebase image with tag "$tag" From 466c5a5627eaad0703ffd4492ff2ce11a7ec5b27 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 12:00:47 -0500 Subject: [PATCH 27/38] same --- .gitlab/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index e5ceabaf8..ed6e0246d 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -145,7 +145,7 @@ build container fb: - ls .gitlab/ - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - - docker push registry.gitlab.com/molecula/featurebase:$CI_COMMIT_SHORT_SHA + - docker push registry.gitlab.com/molecula/featurebase/featurebase:$CI_COMMIT_SHORT_SHA - echo Created docker featurebase image with tag "$tag" From 9669745de6de52090846bfb204c358ab6c2c146d Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 12:04:31 -0500 Subject: [PATCH 28/38] change tag --- .gitlab/.gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index ed6e0246d..af51cd085 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -143,9 +143,9 @@ build container fb: - ls . - echo LIST .gitlab - ls .gitlab/ - - tag=$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA + - tag=$CI_REGISTRY_IMAGE/featurebase:$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - - docker push registry.gitlab.com/molecula/featurebase/featurebase:$CI_COMMIT_SHORT_SHA + - docker push $tag - echo Created docker featurebase image with tag "$tag" From c1746fae5b423c12d52b7490722fcd792783c122 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 13:33:21 -0500 Subject: [PATCH 29/38] add login --- .gitlab/.gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index af51cd085..120f2e46c 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -134,8 +134,11 @@ build container fb: - "build for linux amd64" tags: - shell + # variables: + # - DOCKER_DEPLOY_USER: $DOCKER_DEPLOY_USER + # - DOCKER_DEPLOY_TOKEN: $DOCKER_DEPLOY_TOKEN before_script: - - docker info + - docker login -u $DOCKER_DEPLOY_USER -p $DOCKER_DEPLOY_TOKEN registry.gitlab.com/molecula/featurebase script: - pwd - mv featurebase_linux_amd64 .gitlab/ From 2517e11afd88a6f999f6cc8639509f6c18122d45 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:09:29 -0500 Subject: [PATCH 30/38] try without mv --- .gitlab/.gitlab-ci.yml | 14 +++----------- .gitlab/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 120f2e46c..d18a7b222 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -134,19 +134,11 @@ build container fb: - "build for linux amd64" tags: - shell - # variables: - # - DOCKER_DEPLOY_USER: $DOCKER_DEPLOY_USER - # - DOCKER_DEPLOY_TOKEN: $DOCKER_DEPLOY_TOKEN before_script: - - docker login -u $DOCKER_DEPLOY_USER -p $DOCKER_DEPLOY_TOKEN registry.gitlab.com/molecula/featurebase + - cat $DOCKER_DEPLOY_TOKEN | docker login -u $DOCKER_DEPLOY_USER --password-stdin $CI_REGISTRY_IMAGE script: - - pwd - - mv featurebase_linux_amd64 .gitlab/ - - echo LIST ROOT DIR - - ls . - - echo LIST .gitlab - - ls .gitlab/ - - tag=$CI_REGISTRY_IMAGE/featurebase:$CI_COMMIT_SHORT_SHA + # - mv featurebase_linux_amd64 .gitlab/ + - tag=$CI_REGISTRY_IMAGE/server:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - docker push $tag - echo Created docker featurebase image with tag "$tag" diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index 8b6516c80..5402770ac 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -11,7 +11,7 @@ RUN ls . COPY LICENSE . COPY NOTICE . -COPY .gitlab/featurebase_linux_amd64 . +COPY featurebase_linux_amd64 . ARG SHORT_SHA From fba75f1a0c88c8e876570fa40c3a75b064e113cc Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:16:08 -0500 Subject: [PATCH 31/38] same --- .gitlab/.gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index d18a7b222..f8cd0e7ba 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -135,7 +135,8 @@ build container fb: tags: - shell before_script: - - cat $DOCKER_DEPLOY_TOKEN | docker login -u $DOCKER_DEPLOY_USER --password-stdin $CI_REGISTRY_IMAGE + # - cat $DOCKER_DEPLOY_TOKEN | docker login -u $DOCKER_DEPLOY_USER --password-stdin $CI_REGISTRY_IMAGE + - docker login -u $DOCKER_DEPLOY_USER -p $DOCKER_DEPLOY_TOKEN $CI_REGISTRY_IMAGE script: # - mv featurebase_linux_amd64 .gitlab/ - tag=$CI_REGISTRY_IMAGE/server:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA From e1945bcf1c96dd00a348aa46105c75faa5a4dbd8 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 14:20:51 -0500 Subject: [PATCH 32/38] change commit name to commit slug --- .gitlab/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index f8cd0e7ba..9fa49644a 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -139,7 +139,7 @@ build container fb: - docker login -u $DOCKER_DEPLOY_USER -p $DOCKER_DEPLOY_TOKEN $CI_REGISTRY_IMAGE script: # - mv featurebase_linux_amd64 .gitlab/ - - tag=$CI_REGISTRY_IMAGE/server:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA + - tag=$CI_REGISTRY_IMAGE/server:$CI_COMMIT_REF_SLUG_$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - docker push $tag - echo Created docker featurebase image with tag "$tag" From 3cf8f9db5eeab0896b0ead185188f888156d2e47 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 15:18:13 -0500 Subject: [PATCH 33/38] change tag --- .gitlab/.gitlab-ci.yml | 8 +- .gitlab/LICENSE | 202 ----------------------------------------- .gitlab/NOTICE | 120 ------------------------ 3 files changed, 3 insertions(+), 327 deletions(-) delete mode 100644 .gitlab/LICENSE delete mode 100644 .gitlab/NOTICE diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 9fa49644a..b96e75c45 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -126,7 +126,7 @@ build for linux amd64: # paths: # - featurebase_darwin_arm64 -# Build a Docker image with CI/CD and push to the GitLab registry. +# Build a FB Docker image with CI/CD and push to the GitLab registry. build container fb: image: docker:stable stage: build @@ -135,11 +135,9 @@ build container fb: tags: - shell before_script: - # - cat $DOCKER_DEPLOY_TOKEN | docker login -u $DOCKER_DEPLOY_USER --password-stdin $CI_REGISTRY_IMAGE - docker login -u $DOCKER_DEPLOY_USER -p $DOCKER_DEPLOY_TOKEN $CI_REGISTRY_IMAGE - script: - # - mv featurebase_linux_amd64 .gitlab/ - - tag=$CI_REGISTRY_IMAGE/server:$CI_COMMIT_REF_SLUG_$CI_COMMIT_SHORT_SHA + script: + - tag=$CI_REGISTRY_IMAGE/server:$CI_COMMIT_REF_SLUG/$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - docker push $tag - echo Created docker featurebase image with tag "$tag" diff --git a/.gitlab/LICENSE b/.gitlab/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/.gitlab/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/.gitlab/NOTICE b/.gitlab/NOTICE deleted file mode 100644 index 594272a27..000000000 --- a/.gitlab/NOTICE +++ /dev/null @@ -1,120 +0,0 @@ -Software license -================ - -Copyright (C) 2017-2018 Pilosa Corp. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"). -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -Third-party software licenses -============================= - -The file /pilosa/lru/lru.go contains a redistribution of lru -(github.com/golang/groupcache/lru); the license follows: - - Copyright 2013 Google Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -The file /roaring/btree.go contains a modified redistribution of b -(https://github.com/cznic/b); the license follows: - - Copyright (c) 2014 The b Authors. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the names of the authors nor the names of the - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The file /server/tlsconfig.go contains a modified redistribution of bridge -(https://github.com/robustirc/bridge); the license follows: - - Copyright © 2014-2015 The RobustIRC Authors. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of RobustIRC nor the names of contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The files /logger/filewriter.go and /logger/filewriter_test.go contain a modified redistribution of reopen (github.com/client9/reopen); the license follows: - - The MIT License (MIT) - - Copyright (c) 2015 Nick Galbreath - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. From b1ee2c7a593ff2d84439fa0328ccb01141a0443f Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 15:25:52 -0500 Subject: [PATCH 34/38] same --- .gitlab/.gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index b96e75c45..e9041601f 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -135,9 +135,10 @@ build container fb: tags: - shell before_script: - - docker login -u $DOCKER_DEPLOY_USER -p $DOCKER_DEPLOY_TOKEN $CI_REGISTRY_IMAGE + # - docker login -u $DOCKER_DEPLOY_USER -p $DOCKER_DEPLOY_TOKEN $CI_REGISTRY_IMAGE + - echo "${DOCKER_DEPLOY_TOKEN}" | docker login -u ${DOCKER_DEPLOY_USER} --password-stdin ${CI_REGISTRY} script: - - tag=$CI_REGISTRY_IMAGE/server:$CI_COMMIT_REF_SLUG/$CI_COMMIT_SHORT_SHA + - tag=$CI_REGISTRY_IMAGE/server:$CI_COMMIT_REF_SLUG$CI_COMMIT_SHORT_SHA - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - docker push $tag - echo Created docker featurebase image with tag "$tag" From 64fd686ec49e6d84e98a6b606c5453aca9803e65 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 15:46:02 -0500 Subject: [PATCH 35/38] tag with slug and sha --- .gitlab/.gitlab-ci.yml | 2 +- .gitlab/Dockerfile | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index e9041601f..48da8b317 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -138,7 +138,7 @@ build container fb: # - docker login -u $DOCKER_DEPLOY_USER -p $DOCKER_DEPLOY_TOKEN $CI_REGISTRY_IMAGE - echo "${DOCKER_DEPLOY_TOKEN}" | docker login -u ${DOCKER_DEPLOY_USER} --password-stdin ${CI_REGISTRY} script: - - tag=$CI_REGISTRY_IMAGE/server:$CI_COMMIT_REF_SLUG$CI_COMMIT_SHORT_SHA + - tag=${CI_REGISTRY_IMAGE}/server:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA} - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . - docker push $tag - echo Created docker featurebase image with tag "$tag" diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index 5402770ac..b22392ce1 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -6,16 +6,11 @@ LABEL org.opencontainers.image.authors="dev@molecula.com" WORKDIR /featurebase RUN apk add --no-cache curl jq -RUN pwd -RUN ls . COPY LICENSE . COPY NOTICE . COPY featurebase_linux_amd64 . -ARG SHORT_SHA - -# RUN mv /featurebase_linux_amd64 /featurebase RUN chmod ugo+x . EXPOSE 10101 VOLUME /data From 44148ed79d3156f00f2c701f2c2a213d58d14655 Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Wed, 20 Oct 2021 12:21:05 -0500 Subject: [PATCH 36/38] Build featurebase docker image in CI. Add to registry. --- .gitlab/.gitlab-ci.yml | 26 +++++++++++---------- .gitlab/Dockerfile | 51 ++++++++---------------------------------- 2 files changed, 23 insertions(+), 54 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index cbb7eeffb..cda5430cc 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -4,7 +4,7 @@ include: - template: Security/Dependency-Scanning.gitlab-ci.yml variables: - GO_VERSION: 1.16.3 + GOVERSION: "1.16.3" stages: - test @@ -126,18 +126,20 @@ build for darwin arm64: paths: - featurebase_darwin_arm64 -# Build a Docker image with CI/CD and push to the GitLab registry. +# Build a FB Docker image with CI/CD and push to the GitLab registry. build container fb: - image: docker:latest + image: docker:stable stage: build - services: - - docker:dind - script: - - | - docker build - --build-arg GO_VERSION=$(GO_VERSION) - --tag featurebase:$(VERSION) . - - docker push "$CI_REGISTRY_IMAGE${tag}" - - @echo Created docker image: featurebase:$(VERSION) + needs: + - "build for linux amd64" + tags: + - shell + before_script: + - echo "${DOCKER_DEPLOY_TOKEN}" | docker login -u ${DOCKER_DEPLOY_USER} --password-stdin ${CI_REGISTRY} + script: + - tag=${CI_REGISTRY_IMAGE}/server:${CI_COMMIT_REF_SLUG} + - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . + - docker push $tag + - echo Created docker featurebase image with tag "$tag" diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index 115855034..b22392ce1 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -1,50 +1,17 @@ -ARG GO_VERSION=latest - -####################### -### Lattice builder ### -####################### - -FROM moleculacorp/nodejs:latest as lattice-builder -WORKDIR /lattice - -COPY lattice/package.json ./ -COPY lattice/yarn.lock ./ -RUN yarn install - -COPY lattice ./ -RUN yarn build - -###################### -### Pilosa builder ### -###################### - -FROM golang:${GO_VERSION} as pilosa-builder -ARG MAKE_FLAGS -WORKDIR /pilosa - -RUN go get github.com/rakyll/statik - -COPY . ./ -COPY --from=lattice-builder /lattice/build /lattice -RUN /go/bin/statik -src=/lattice -dest=/pilosa - -RUN make build FLAGS="-o build/featurebase" ${MAKE_FLAGS} - -##################### -### Pilosa runner ### -##################### - -FROM alpine:3.13.2 as runner +FROM alpine:3.14.2 LABEL maintainer "dev@molecula.com" +LABEL org.opencontainers.image.authors="dev@molecula.com" + +WORKDIR /featurebase RUN apk add --no-cache curl jq -COPY --from=pilosa-builder /pilosa/build/featurebase / - -COPY LICENSE /LICENSE -COPY NOTICE /NOTICE +COPY LICENSE . +COPY NOTICE . +COPY featurebase_linux_amd64 . +RUN chmod ugo+x . EXPOSE 10101 VOLUME /data @@ -53,4 +20,4 @@ ENV PILOSA_BIND 0.0.0.0:10101 ENV PILOSA_BIND_GRPC 0.0.0.0:20101 ENTRYPOINT ["/featurebase"] -CMD ["server"] +CMD ["server"] \ No newline at end of file From c9d25909be31f7d47dc69c1558d97bef02d5e23e Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Thu, 21 Oct 2021 16:27:43 -0500 Subject: [PATCH 37/38] cleanup --- .gitlab/.gitlab-ci.yml | 200 ++++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 76baad586..cda5430cc 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -1,82 +1,82 @@ -# include: -# - template: Security/SAST.gitlab-ci.yml -# - template: Security/License-Scanning.gitlab-ci.yml -# - template: Security/Dependency-Scanning.gitlab-ci.yml +include: + - template: Security/SAST.gitlab-ci.yml + - template: Security/License-Scanning.gitlab-ci.yml + - template: Security/Dependency-Scanning.gitlab-ci.yml variables: GOVERSION: "1.16.3" stages: - # - test + - test - build -# install lattice: -# stage: test -# image: node:14 -# script: -# - echo "Installing lattice dependencies..." -# - cd lattice -# - yarn install +install lattice: + stage: test + image: node:14 + script: + - echo "Installing lattice dependencies..." + - cd lattice + - yarn install -# build lattice: -# stage: test -# image: node:14 -# variables: -# CI: "true" -# script: -# - echo "Building lattice..." -# - cd lattice -# - yarn build -# - tar -czvf lattice.tar.gz lattice/build -# artifacts: -# paths: -# - lattice/lattice.tar.gz -# needs: -# - job: install lattice -# allow_failure: true +build lattice: + stage: test + image: node:14 + variables: + CI: "true" + script: + - echo "Building lattice..." + - cd lattice + - yarn build + - tar -czvf lattice.tar.gz lattice/build + artifacts: + paths: + - lattice/lattice.tar.gz + needs: + - job: install lattice + allow_failure: true -# run go tests: -# stage: test -# image: golang:1.16.9 -# script: -# - echo "Running featurebase unit tests..." -# - go test -covermode=atomic -coverprofile=coverage.out -# artifacts: -# paths: -# - coverage.out +run go tests: + stage: test + image: golang:1.16.9 + script: + - echo "Running featurebase unit tests..." + - go test -covermode=atomic -coverprofile=coverage.out + artifacts: + paths: + - coverage.out -# run go tests with output: -# stage: test -# image: golang:1.16.9 -# script: -# - echo "Running featurebase unit tests to capture JSON output..." -# - go test -json > test-report.out -# artifacts: -# paths: -# - test-report.out +run go tests with output: + stage: test + image: golang:1.16.9 + script: + - echo "Running featurebase unit tests to capture JSON output..." + - go test -json > test-report.out + artifacts: + paths: + - test-report.out -# generate coverage html: -# stage: test -# image: golang:1.16.9 -# script: -# - echo "Generating coverage HTML.." -# - go tool cover -html coverage.out -o coverage.html -# artifacts: -# paths: -# - coverage.html -# needs: -# - job: run go tests +generate coverage html: + stage: test + image: golang:1.16.9 + script: + - echo "Generating coverage HTML.." + - go tool cover -html coverage.out -o coverage.html + artifacts: + paths: + - coverage.html + needs: + - job: run go tests -# upload to sonarcloud: -# stage: test -# image: sonarsource/sonar-scanner-cli:4.6 -# variables: -# SONAR_TOKEN: $SONAR_TOKEN -# script: -# - sonar-scanner -Dsonar.projectKey=molecula_featurebase -Dsonar.organization=molecula -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.go.coverage.reportPaths=coverage.out -Dsonar.go.tests.reportPaths=test-report.out -# needs: -# - job: run go tests -# - job: run go tests with output +upload to sonarcloud: + stage: test + image: sonarsource/sonar-scanner-cli:4.6 + variables: + SONAR_TOKEN: $SONAR_TOKEN + script: + - sonar-scanner -Dsonar.projectKey=molecula_featurebase -Dsonar.organization=molecula -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.go.coverage.reportPaths=coverage.out -Dsonar.go.tests.reportPaths=test-report.out + needs: + - job: run go tests + - job: run go tests with output build for linux amd64: stage: build @@ -90,41 +90,41 @@ build for linux amd64: paths: - featurebase_linux_amd64 -# build for linux arm64: -# stage: build -# image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 -# variables: -# GOOS: "linux" -# GOARCH: "arm64" -# script: -# - go build -o featurebase_linux_arm64 ./cmd/featurebase -# artifacts: -# paths: -# - featurebase_linux_arm64 +build for linux arm64: + stage: build + image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 + variables: + GOOS: "linux" + GOARCH: "arm64" + script: + - go build -o featurebase_linux_arm64 ./cmd/featurebase + artifacts: + paths: + - featurebase_linux_arm64 -# build for darwin amd64: -# stage: build -# image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 -# variables: -# GOOS: "darwin" -# GOARCH: "amd64" -# script: -# - go build -o featurebase_darwin_amd64 ./cmd/featurebase -# artifacts: -# paths: -# - featurebase_darwin_amd64 +build for darwin amd64: + stage: build + image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 + variables: + GOOS: "darwin" + GOARCH: "amd64" + script: + - go build -o featurebase_darwin_amd64 ./cmd/featurebase + artifacts: + paths: + - featurebase_darwin_amd64 -# build for darwin arm64: -# stage: build -# image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 -# variables: -# GOOS: "darwin" -# GOARCH: "arm64" -# script: -# - go build -o featurebase_darwin_arm64 ./cmd/featurebase -# artifacts: -# paths: -# - featurebase_darwin_arm64 +build for darwin arm64: + stage: build + image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 + variables: + GOOS: "darwin" + GOARCH: "arm64" + script: + - go build -o featurebase_darwin_arm64 ./cmd/featurebase + artifacts: + paths: + - featurebase_darwin_arm64 # Build a FB Docker image with CI/CD and push to the GitLab registry. build container fb: From a084ad0753a8cdc1095d8d56f9e2ec4c7dc06d0d Mon Sep 17 00:00:00 2001 From: Samir Patel <48686912+54mir@users.noreply.github.com> Date: Mon, 1 Nov 2021 10:44:01 -0500 Subject: [PATCH 38/38] Up goverversion to 1.16.9 --- .gitlab/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index cda5430cc..c159da7db 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -4,7 +4,7 @@ include: - template: Security/Dependency-Scanning.gitlab-ci.yml variables: - GOVERSION: "1.16.3" + GOVERSION: "1.16.9" stages: - test