Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[BACK-3295] Implement private plugin functionality in platform #795

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ coverprofile.out
/_data/
/_log/
/_tmp/
/deploy/

# Development environments
/.gvm_local
/.idea

# Travis CI
mongod.log
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*.env
.envrc

# Go
go.work
go.work.sum

# Debug binaries
debug
__debug_bin*
Expand All @@ -22,7 +26,10 @@ coverprofile.out
/_data/
/_log/
/_tmp/
/deploy/

# Development environments
/.gvm_local
/.idea

# Travis CI
mongod.log
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "private/plugin/redwood"]
path = private/plugin/redwood
url = https://github.com/tidepool-org/platform-plugin-redwood
update = none
45 changes: 0 additions & 45 deletions .golintignore

This file was deleted.

20 changes: 7 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
os: linux

dist: jammy

language: go

go:
- 1.22.2
- 1.23.4

services:
- docker

env:
global:
- MONGODB=6.0.14
- MONGOSH=2.2.3
- MONGODB=6.0.19
- MONGOSH=2.3.7

cache:
directories:
Expand All @@ -21,7 +23,7 @@ before_install:
- sudo apt-get update
- sudo apt-get install --allow-downgrades -y docker-buildx-plugin mongodb-org=${MONGODB} mongodb-org-database=${MONGODB} mongodb-org-server=${MONGODB} mongodb-mongosh=${MONGOSH} mongodb-org-mongos=${MONGODB} mongodb-org-tools
- mkdir /tmp/data
- /usr/bin/mongod --dbpath /tmp/data --bind_ip 127.0.0.1 --replSet rs0 --logpath ${PWD}/mongod.log &> /dev/null &
- /usr/bin/mongod --dbpath /tmp/data --bind_ip 127.0.0.1 --replSet rs0 --logpath /tmp/mongod.log &> /dev/null &
- until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 1; done
- /usr/bin/mongosh --eval 'rs.initiate(); while (rs.status().startupStatus || (rs.status().hasOwnProperty("myState") && rs.status().myState != 1)) { printjson( rs.status() ); sleep(1000); }; printjson( rs.status() );'

Expand All @@ -30,14 +32,6 @@ addons:
sources:
- sourceline: 'deb https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse'
key_url: 'https://pgp.mongodb.com/server-6.0.asc'
artifacts:
s3_region: us-west-2
paths:
- $(git ls-files -o deploy/*/*-*.tar.gz | tr "\n" ":")
target_paths:
- /
code_climate:
repo_token: 91ded9b66924acbe830541ab3593daf535f05f7c6db91b5cbd2d26dcf37da0b8

script:
- make ci-generate ci-build go-ci-test ci-deploy ci-docker TIMING_CMD="time -p"
- make plugins-visibility-public && make ci && make plugins-visibility-private && make ci
29 changes: 13 additions & 16 deletions Dockerfile.auth
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# Development
FROM golang:1.22.2-alpine AS development
WORKDIR /go/src/github.com/tidepool-org/platform
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk --no-cache add make git ca-certificates tzdata && \
go install github.com/githubnemo/CompileDaemon@v1.4.0 && \
adduser -D tidepool && \
chown -R tidepool /go/src/github.com/tidepool-org/platform
FROM golang:1.23.4-alpine AS development
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata git make
RUN [ ! -d /go/pkg/mod ] || chmod -R go+w /go/pkg/mod
RUN adduser --disabled-password tidepool
USER tidepool
COPY --chown=tidepool . .
WORKDIR /go/src/github.com/tidepool-org/platform
COPY --chown=tidepool:tidepool . .
RUN ["make", "CompileDaemon"]
RUN ["make", "plugins-visibility"]
RUN ["make", "services-build-common"]
ENV SERVICE=services/auth
RUN ["make", "service-build"]
CMD ["make", "service-start"]

# Production
FROM alpine:latest AS production
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk add --no-cache ca-certificates tzdata && \
adduser -D tidepool
WORKDIR /home/tidepool
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata
RUN adduser --disabled-password tidepool
USER tidepool
COPY --from=development --chown=tidepool /go/src/github.com/tidepool-org/platform/_bin/services/auth/ .
WORKDIR /home/tidepool
COPY --from=development --chown=tidepool:tidepool /go/src/github.com/tidepool-org/platform/_bin/services/auth/ .
CMD ["./auth"]
29 changes: 13 additions & 16 deletions Dockerfile.blob
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# Development
FROM golang:1.22.2-alpine AS development
WORKDIR /go/src/github.com/tidepool-org/platform
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk --no-cache add make git ca-certificates tzdata && \
go install github.com/githubnemo/CompileDaemon@v1.4.0 && \
adduser -D tidepool && \
chown -R tidepool /go/src/github.com/tidepool-org/platform
FROM golang:1.23.4-alpine AS development
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata git make
RUN [ ! -d /go/pkg/mod ] || chmod -R go+w /go/pkg/mod
RUN adduser --disabled-password tidepool
USER tidepool
COPY --chown=tidepool . .
WORKDIR /go/src/github.com/tidepool-org/platform
COPY --chown=tidepool:tidepool . .
RUN ["make", "CompileDaemon"]
RUN ["make", "plugins-visibility"]
RUN ["make", "services-build-common"]
ENV SERVICE=services/blob
RUN ["make", "service-build"]
CMD ["make", "service-start"]

# Production
FROM alpine:latest AS production
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk add --no-cache ca-certificates tzdata && \
adduser -D tidepool
WORKDIR /home/tidepool
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata
RUN adduser --disabled-password tidepool
USER tidepool
COPY --from=development --chown=tidepool /go/src/github.com/tidepool-org/platform/_bin/services/blob/ .
WORKDIR /home/tidepool
COPY --from=development --chown=tidepool:tidepool /go/src/github.com/tidepool-org/platform/_bin/services/blob/ .
CMD ["./blob"]
29 changes: 13 additions & 16 deletions Dockerfile.data
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# Development
FROM golang:1.22.2-alpine AS development
WORKDIR /go/src/github.com/tidepool-org/platform
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk --no-cache add make git ca-certificates tzdata && \
go install github.com/githubnemo/CompileDaemon@v1.4.0 && \
adduser -D tidepool && \
chown -R tidepool /go/src/github.com/tidepool-org/platform
FROM golang:1.23.4-alpine AS development
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata git make
RUN [ ! -d /go/pkg/mod ] || chmod -R go+w /go/pkg/mod
RUN adduser --disabled-password tidepool
USER tidepool
COPY --chown=tidepool . .
WORKDIR /go/src/github.com/tidepool-org/platform
COPY --chown=tidepool:tidepool . .
RUN ["make", "CompileDaemon"]
RUN ["make", "plugins-visibility"]
RUN ["make", "services-build-common"]
ENV SERVICE=services/data
RUN ["make", "service-build"]
CMD ["make", "service-start"]

# Production
FROM alpine:latest AS production
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk add --no-cache ca-certificates tzdata && \
adduser -D tidepool
WORKDIR /home/tidepool
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata
RUN adduser --disabled-password tidepool
USER tidepool
COPY --from=development --chown=tidepool /go/src/github.com/tidepool-org/platform/_bin/services/data/ .
WORKDIR /home/tidepool
COPY --from=development --chown=tidepool:tidepool /go/src/github.com/tidepool-org/platform/_bin/services/data/ .
CMD ["./data"]
29 changes: 13 additions & 16 deletions Dockerfile.migrations
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# Development
FROM golang:1.22.2-alpine AS development
WORKDIR /go/src/github.com/tidepool-org/platform
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk --no-cache add make git ca-certificates tzdata && \
go install github.com/githubnemo/CompileDaemon@v1.4.0 && \
adduser -D tidepool && \
chown -R tidepool /go/src/github.com/tidepool-org/platform
FROM golang:1.23.4-alpine AS development
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata git make
RUN [ ! -d /go/pkg/mod ] || chmod -R go+w /go/pkg/mod
RUN adduser --disabled-password tidepool
USER tidepool
COPY --chown=tidepool . .
WORKDIR /go/src/github.com/tidepool-org/platform
COPY --chown=tidepool:tidepool . .
RUN ["make", "CompileDaemon"]
RUN ["make", "plugins-visibility"]
RUN ["make", "services-build-common"]
ENV SERVICE=migrations
RUN ["make", "service-build"]
CMD ["make", "service-start"]

# Production
FROM alpine:latest AS production
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk add --no-cache ca-certificates tzdata && \
adduser -D tidepool
WORKDIR /home/tidepool
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata
RUN adduser --disabled-password tidepool
USER tidepool
COPY --from=development --chown=tidepool /go/src/github.com/tidepool-org/platform/_bin/migrations/ .
WORKDIR /home/tidepool
COPY --from=development --chown=tidepool:tidepool /go/src/github.com/tidepool-org/platform/_bin/migrations/ .
CMD ["./migrations"]
29 changes: 13 additions & 16 deletions Dockerfile.prescription
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# Development
FROM golang:1.22.2-alpine AS development
WORKDIR /go/src/github.com/tidepool-org/platform
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk --no-cache add make git ca-certificates tzdata && \
go install github.com/githubnemo/CompileDaemon@v1.4.0 && \
adduser -D tidepool && \
chown -R tidepool /go/src/github.com/tidepool-org/platform
FROM golang:1.23.4-alpine AS development
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata git make
RUN [ ! -d /go/pkg/mod ] || chmod -R go+w /go/pkg/mod
RUN adduser --disabled-password tidepool
USER tidepool
COPY --chown=tidepool . .
WORKDIR /go/src/github.com/tidepool-org/platform
COPY --chown=tidepool:tidepool . .
RUN ["make", "CompileDaemon"]
RUN ["make", "plugins-visibility"]
RUN ["make", "services-build-common"]
ENV SERVICE=services/prescription
RUN ["make", "service-build"]
CMD ["make", "service-start"]

# Production
FROM alpine:latest AS production
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk add --no-cache ca-certificates tzdata && \
adduser -D tidepool
WORKDIR /home/tidepool
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata
RUN adduser --disabled-password tidepool
USER tidepool
COPY --from=development --chown=tidepool /go/src/github.com/tidepool-org/platform/_bin/services/prescription/ .
WORKDIR /home/tidepool
COPY --from=development --chown=tidepool:tidepool /go/src/github.com/tidepool-org/platform/_bin/services/prescription/ .
CMD ["./prescription"]
29 changes: 13 additions & 16 deletions Dockerfile.task
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# Development
FROM golang:1.22.2-alpine AS development
WORKDIR /go/src/github.com/tidepool-org/platform
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk --no-cache add make git ca-certificates tzdata && \
go install github.com/githubnemo/CompileDaemon@v1.4.0 && \
adduser -D tidepool && \
chown -R tidepool /go/src/github.com/tidepool-org/platform
FROM golang:1.23.4-alpine AS development
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata git make
RUN [ ! -d /go/pkg/mod ] || chmod -R go+w /go/pkg/mod
RUN adduser --disabled-password tidepool
USER tidepool
COPY --chown=tidepool . .
WORKDIR /go/src/github.com/tidepool-org/platform
COPY --chown=tidepool:tidepool . .
RUN ["make", "CompileDaemon"]
RUN ["make", "plugins-visibility"]
RUN ["make", "services-build-common"]
ENV SERVICE=services/task
RUN ["make", "service-build"]
CMD ["make", "service-start"]

# Production
FROM alpine:latest AS production
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk add --no-cache ca-certificates tzdata && \
adduser -D tidepool
WORKDIR /home/tidepool
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata
RUN adduser --disabled-password tidepool
USER tidepool
COPY --from=development --chown=tidepool /go/src/github.com/tidepool-org/platform/_bin/services/task/ .
WORKDIR /home/tidepool
COPY --from=development --chown=tidepool:tidepool /go/src/github.com/tidepool-org/platform/_bin/services/task/ .
CMD ["./task"]
Loading