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/BACK-3332] Implement private plugin functionality in platform, update dependencies #803

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 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.
26 changes: 0 additions & 26 deletions .codeclimate.yml

This file was deleted.

69 changes: 56 additions & 13 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,68 @@
# Environment
*.env
.envrc
env*.sh
private/plugin/redwood/*.env
!version.env

# Debug binaries
# Debug
debug
__debug_bin*

# Test output
# Test
*.coverprofile
*.test
coverprofile.out
ginkgo.report
test
*_test.go
*/test
*/*_test.go
*/*/test
*/*/*_test.go
*/*/*/test
*/*/*/*_test.go
*/*/*/*/test
*/*/*/*/*_test.go
*/*/*/*/*/test
*/*/*/*/*/*_test.go
*/*/*/*/*/*/test
*/*/*/*/*/*/*_test.go
*/*/*/*/*/*/*/test
*/*/*/*/*/*/*/*_test.go

# Test coverage output
*.coverprofile
coverprofile.out
# Project
vendor
_bin
_data
_log
_tmp

# Development
.gvm_local
.idea
.vscode
.govetignore
private/plugin/redwood/.govetignore

# Documentation
CHANGELOG.md
LICENSE
README.md
*/README.md
*/*/README.md
*/*/*/README.md

# Git
.git
.gitignore
.gitmodules
private/plugin/redwood/.git
private/plugin/redwood/.gitignore

# Project directories
/_bin/
/_data/
/_log/
/_tmp/
/deploy/
# Travis
.travis.yml

# Development environments
/.idea
# Docker
.dockerignore
Dockerfile*
31 changes: 17 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
*.env
.envrc

# Debug binaries
# Go
go.work
go.work.sum

# Debug
debug
__debug_bin*

# Test output
*.test
ginkgo.report

# Test coverage output
# Test
*.coverprofile
*.test
coverprofile.out
ginkgo.report

# Project directories
/_bin/
/_data/
/_log/
/_tmp/
/deploy/
# Project
vendor
_bin
_data
_log
_tmp

# Development environments
/.idea
# Development
.gvm_local
.idea
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.

27 changes: 13 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
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.8
jobs:
- PLUGINS_VISIBILITY=public
- PLUGINS_VISIBILITY=private

cache:
directories:
Expand All @@ -20,24 +25,18 @@ cache:
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 &
- mkdir -p /var/ramfs/mongodb/data
- /usr/bin/mongod --dbpath /var/ramfs/mongodb/data --bind_ip 127.0.0.1 --replSet rs0 --logpath /var/ramfs/mongodb/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() );'
- echo -e "machine github.com\n login $GITHUB_TOKEN" > ~/.netrc

addons:
apt:
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"
- export TIMING_CMD='time -p'
- make plugins-visibility-${PLUGINS_VISIBILITY} && make ci
34 changes: 24 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/services/auth",
"buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'",
"buildFlags": "-mod=readonly -ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'",
"cwd": "${workspaceRoot}",
"hideSystemGoroutines": true,
"envFile": "${workspaceRoot}/auth.env",
"env": {
"TIDEPOOL_DEBUG_NAME": "auth"
"TIDEPOOL_DEBUG_NAME": "auth",
"TIDEPOOL_LOGGER_LEVEL": "debug"
}
},
{
Expand All @@ -20,11 +22,13 @@
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/services/data",
"buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'",
"buildFlags": "-mod=readonly -ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'",
"cwd": "${workspaceRoot}",
"hideSystemGoroutines": true,
"envFile": "${workspaceRoot}/data.env",
"env": {
"TIDEPOOL_DEBUG_NAME": "data"
"TIDEPOOL_DEBUG_NAME": "data",
"TIDEPOOL_LOGGER_LEVEL": "debug"
}
},
{
Expand All @@ -33,11 +37,13 @@
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/services/notification",
"buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'",
"buildFlags": "-mod=readonly -ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'",
"cwd": "${workspaceRoot}",
"hideSystemGoroutines": true,
"envFile": "${workspaceRoot}/notification.env",
"env": {
"TIDEPOOL_DEBUG_NAME": "notification"
"TIDEPOOL_DEBUG_NAME": "notification",
"TIDEPOOL_LOGGER_LEVEL": "debug"
}
},
{
Expand All @@ -46,11 +52,13 @@
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/services/task",
"buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'",
"buildFlags": "-mod=readonly -ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'",
"cwd": "${workspaceRoot}",
"hideSystemGoroutines": true,
"envFile": "${workspaceRoot}/task.env",
"env": {
"TIDEPOOL_DEBUG_NAME": "task"
"TIDEPOOL_DEBUG_NAME": "task",
"TIDEPOOL_LOGGER_LEVEL": "debug"
}
},
{
Expand All @@ -59,15 +67,21 @@
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/services/user",
"buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'",
"buildFlags": "-mod=readonly -ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'",
"cwd": "${workspaceRoot}",
"hideSystemGoroutines": true,
"envFile": "${workspaceRoot}/user.env",
"env": {
"TIDEPOOL_DEBUG_NAME": "user"
"TIDEPOOL_DEBUG_NAME": "user",
"TIDEPOOL_LOGGER_LEVEL": "debug"
}
}
],
"compounds": [
{
"name": "auth, data",
"configurations": ["auth", "data"]
},
{
"name": "auth, task",
"configurations": ["auth", "task"]
Expand Down
28 changes: 9 additions & 19 deletions Dockerfile.auth
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
# Development
FROM golang:1.22.2-alpine AS development
# Build
FROM golang:1.23.4-alpine AS build
RUN apk --no-cache update && apk --no-cache upgrade && apk --no-cache add ca-certificates tzdata git make
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/[email protected] && \
adduser -D tidepool && \
chown -R tidepool /go/src/github.com/tidepool-org/platform
USER tidepool
COPY --chown=tidepool . .
ENV SERVICE=services/auth
RUN ["make", "service-build"]
CMD ["make", "service-start"]
COPY . .
RUN make init plugins-visibility build

# 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=build --chown=tidepool:tidepool /go/src/github.com/tidepool-org/platform/_bin/services/auth/ .
CMD ["./auth"]
Loading