Skip to content

Commit bd80ff0

Browse files
committed
First commit
0 parents  commit bd80ff0

File tree

23 files changed

+850
-0
lines changed

23 files changed

+850
-0
lines changed

.circleci/config.yml

+209
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
version: 2.1
2+
3+
orbs:
4+
codecov: codecov/codecov@1
5+
snyk: snyk/[email protected]
6+
7+
executors:
8+
gradle_docker:
9+
docker:
10+
- image: cimg/openjdk:11.0
11+
auth:
12+
username: $DOCKERHUB_USERNAME
13+
password: $DOCKERHUB_PASSWORD
14+
gradle_machine:
15+
machine:
16+
image: ubuntu-1604:201903-01
17+
helm:
18+
docker:
19+
- image: hypertrace/helm-gcs-packager:0.3.0
20+
auth:
21+
username: $DOCKERHUB_USERNAME
22+
password: $DOCKERHUB_PASSWORD
23+
buf:
24+
docker:
25+
- image: bufbuild/buf:0.18.1
26+
auth:
27+
username: $DOCKERHUB_USERNAME
28+
password: $DOCKERHUB_PASSWORD
29+
30+
commands:
31+
gradle:
32+
description: 'Run the provided gradle command'
33+
parameters:
34+
args:
35+
type: string
36+
steps:
37+
- run: ./gradlew << parameters.args >> --info --max-workers=2 -Dorg.gradle.jvmargs=-Xmx2g -Dorg.gradle.console=plain --continue
38+
setup_build_environment:
39+
description: 'Generates cache key from a hash of all gradle files'
40+
steps:
41+
- checkout
42+
- run:
43+
name: Generate cache key
44+
# Find all gradle related files, hash each and order them consistently, then save to file for later use
45+
command: find . -type f -name "*.gradle*" -o -name "gradle-wrapper*" | xargs shasum | sort > /tmp/checksum.txt && cat /tmp/checksum.txt
46+
- restore_cache:
47+
keys:
48+
- v1-dependencies-{{ checksum "/tmp/checksum.txt" }}
49+
# fallback to using the latest cache if no exact match is found
50+
- v1-dependencies-
51+
populate_and_save_cache:
52+
description: 'Downloads all gradle dependencies and uploads cache for later use'
53+
steps:
54+
- gradle:
55+
args: downloadDependencies
56+
- save_cache:
57+
paths:
58+
- ~/.gradle
59+
key: v1-dependencies-{{ checksum "/tmp/checksum.txt" }}
60+
docker_login:
61+
description: "Login to dockerhub with readonly credentials"
62+
steps:
63+
- run:
64+
name: Dockerhub login
65+
command: echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USERNAME --password-stdin
66+
67+
jobs:
68+
build:
69+
executor: gradle_docker
70+
steps:
71+
- setup_build_environment
72+
- setup_remote_docker: &latest_remote_docker
73+
version: 19.03.12
74+
- populate_and_save_cache
75+
- docker_login
76+
- gradle:
77+
args: build dockerBuildImages
78+
- gradle:
79+
args: jacocoTestReport
80+
- codecov/upload:
81+
flags: unit
82+
verify-protos:
83+
executor: buf
84+
# TODO: Re-enable buf
85+
steps:
86+
- checkout
87+
- run: buf check lint
88+
# - run: buf check breaking --against-input "ssh://${CIRCLE_REPOSITORY_URL/://}#branch=main"
89+
merge-publish:
90+
executor: gradle_docker
91+
steps:
92+
- setup_build_environment
93+
- setup_remote_docker: *latest_remote_docker
94+
- docker_login
95+
- gradle:
96+
args: dockerPushImages
97+
release-publish:
98+
executor: gradle_docker
99+
steps:
100+
- setup_build_environment
101+
- setup_remote_docker: *latest_remote_docker
102+
- docker_login
103+
- gradle:
104+
args: publish dockerPushImages
105+
validate-charts:
106+
executor: helm
107+
steps:
108+
- checkout
109+
- run:
110+
name: Helm Charts Lint and Template Render
111+
command: |
112+
helm dependency update ./helm/
113+
helm lint --strict ./helm/
114+
helm template ./helm/
115+
snyk-scan:
116+
executor:
117+
name: gradle_docker
118+
environment:
119+
GRADLE_OPTS: -Dorg.gradle.workers.max=1 # Snyk doesn't handle parallelism well
120+
steps:
121+
- setup_build_environment
122+
- snyk/scan:
123+
additional-arguments: --all-sub-projects --policy-path=.snyk
124+
release-charts:
125+
executor: helm
126+
steps:
127+
- checkout
128+
- run:
129+
name: Add release tag
130+
command: |
131+
git config --global user.email "${CIRCLE_USERNAME}@hypertrace.org"
132+
git config --global user.name "$CIRCLE_USERNAME"
133+
git tag -am "Released by $CIRCLE_USERNAME" $(git describe --abbrev=0 --tags | sed 's/^release-//')
134+
- run:
135+
name: Remove trigger tag
136+
command: git tag -d release-$(git describe --abbrev=0)
137+
- run:
138+
name: Package and Publish Helm Charts
139+
# Read the "name:" from Chart.yaml. The chart version is <chart-name>-<semver git tag>
140+
command: |
141+
CHART_VERSION=$(git describe --abbrev=0)
142+
CHART_NAME=$(awk '/^name:/ {print $2}' ./helm/Chart.yaml)
143+
export GOOGLE_APPLICATION_CREDENTIALS=${HOME}/helm-gcs-key.json
144+
echo ${HELM_GCS_CREDENTIALS} > ${GOOGLE_APPLICATION_CREDENTIALS}
145+
helm dependency update ./helm/
146+
helm repo add helm-gcs ${HELM_GCS_REPOSITORY}
147+
helm package --version ${CHART_VERSION} --app-version ${CHART_VERSION} ./helm/
148+
helm gcs push ${CHART_NAME}-${CHART_VERSION}.tgz helm-gcs --public --retry
149+
- add_ssh_keys:
150+
fingerprints:
151+
# This ssh key gives write permission needed for the following step.
152+
- '<REPLACEME>'
153+
- run:
154+
name: Update remote tags
155+
command: git push origin refs/tags/$(git describe --abbrev=0) :refs/tags/release-$(git describe --abbrev=0)
156+
157+
workflows:
158+
version: 2
159+
build-and-publish:
160+
jobs:
161+
- build:
162+
context:
163+
- dockerhub-read
164+
- validate-charts:
165+
context:
166+
- dockerhub-read
167+
- verify-protos:
168+
context:
169+
- dockerhub-read
170+
filters:
171+
branches:
172+
ignore:
173+
- main
174+
- snyk-scan:
175+
context:
176+
- hypertrace-vulnerability-scanning
177+
- dockerhub-read
178+
- merge-publish:
179+
context:
180+
- hypertrace-publishing
181+
- dockerhub-read
182+
requires:
183+
- build
184+
- validate-charts
185+
- snyk-scan
186+
filters:
187+
branches:
188+
only:
189+
- main
190+
- release-publish:
191+
context:
192+
- hypertrace-publishing
193+
- dockerhub-read
194+
filters:
195+
branches:
196+
ignore: /.*/
197+
tags:
198+
only: /^release-.*/
199+
- release-charts:
200+
context:
201+
- hypertrace-publishing
202+
- dockerhub-read
203+
requires:
204+
- release-publish
205+
filters:
206+
branches:
207+
ignore: /.*/
208+
tags:
209+
only: /^release-.*/

.github/CODEOWNERS

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Each line is a file pattern followed by one or more owners.
2+
3+
# global
4+
* @GurtejSohi @buchi-busireddy @aaron-steinfeld @pavan-traceable

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
6+
7+
.idea

LICENSE.txt

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
Traceable Community License Agreement
2+
Version 1.0, July 2020
3+
4+
This Traceable Community License Agreement Version 1.0 (the “Agreement”) sets
5+
forth the terms on which Traceable, Inc. (“Traceable”) makes available certain
6+
software made available by Traceable under this Agreement (the “Software”).  BY
7+
INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF THE SOFTWARE,
8+
YOU AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO
9+
SUCH TERMS AND CONDITIONS, YOU MUST NOT USE THE SOFTWARE.  IF YOU ARE RECEIVING
10+
THE SOFTWARE ON BEHALF OF A LEGAL ENTITY, YOU REPRESENT AND WARRANT THAT YOU
11+
HAVE THE ACTUAL AUTHORITY TO AGREE TO THE TERMS AND CONDITIONS OF THIS
12+
AGREEMENT ON BEHALF OF SUCH ENTITY. “Licensee” means you, an individual, or
13+
the entity on whose behalf you are receiving the Software.
14+
15+
1. LICENSE GRANT AND CONDITIONS.
16+
17+
1.1 License.  Subject to the terms and conditions of this Agreement,
18+
Traceable hereby grants to Licensee a non-exclusive, royalty-free,
19+
worldwide, non-transferable, non-sublicenseable license during the term
20+
of this Agreement to: (a) use the Software; (b) prepare modifications and
21+
derivative works of the Software; (c) distribute the Software (including
22+
without limitation in source code or object code form); and (d) reproduce
23+
copies of the Software (the “License”).  Licensee is not granted the
24+
right to, and Licensee shall not, exercise the License for an Excluded
25+
Purpose.  For purposes of this Agreement, “Excluded Purpose” means making
26+
available any software-as-a-service, platform-as-a-service,
27+
infrastructure-as-a-service or other similar online service that competes
28+
with Traceable products or services that provide the Software.
29+
30+
1.2 Conditions.  In consideration of the License, Licensee’s distribution
31+
of the Software is subject to the following conditions:
32+
33+
(a) Licensee must cause any Software modified by Licensee to carry
34+
prominent notices stating that Licensee modified the Software.
35+
36+
(b) On each Software copy, Licensee shall reproduce and not remove or
37+
alter all Traceable or third party copyright or other proprietary
38+
notices contained in the Software, and Licensee must provide the
39+
notice below with each copy.  
40+
41+
“This software is made available by Traceable, Inc., under the
42+
terms of the Traceable Community License Agreement, Version 1.0.
43+
BY INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING ANY OF
44+
THE SOFTWARE, YOU AGREE TO THE TERMS OF SUCH LICENSE AGREEMENT.”
45+
46+
1.3 Licensee Modifications.  Licensee may add its own copyright notices
47+
to modifications made by Licensee and may provide additional or different
48+
license terms and conditions for use, reproduction, or distribution of
49+
Licensee’s modifications.  While redistributing the Software or
50+
modifications thereof, Licensee may choose to offer, for a fee or free of
51+
charge, support, warranty, indemnity, or other obligations. Licensee, and
52+
not Traceable, will be responsible for any such obligations.
53+
54+
1.4 No Sublicensing.  The License does not include the right to
55+
sublicense the Software, however, each recipient to which Licensee
56+
provides the Software may exercise the Licenses so long as such recipient
57+
agrees to the terms and conditions of this Agreement.  
58+
59+
2. TERM AND TERMINATION.  This Agreement will continue unless and until
60+
earlier terminated as set forth herein.  If Licensee breaches any of its
61+
conditions or obligations under this Agreement, this Agreement will
62+
terminate automatically and the License will terminate automatically and
63+
permanently.
64+
65+
3. INTELLECTUAL PROPERTY.  As between the parties, Traceable will retain all
66+
right, title, and interest in the Software, and all intellectual property
67+
rights therein.  Traceable hereby reserves all rights not expressly granted
68+
to Licensee in this Agreement. Traceable hereby reserves all rights in its
69+
trademarks and service marks, and no licenses therein are granted in this
70+
Agreement.
71+
72+
4. DISCLAIMER. TRACEABLE HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND
73+
CONDITIONS, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, AND SPECIFICALLY
74+
DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
75+
PURPOSE, WITH RESPECT TO THE SOFTWARE.  
76+
77+
5. LIMITATION OF LIABILITY. TRACEABLE WILL NOT BE LIABLE FOR ANY DAMAGES OF
78+
ANY KIND, INCLUDING BUT NOT LIMITED TO, LOST PROFITS OR ANY CONSEQUENTIAL,
79+
SPECIAL, INCIDENTAL, INDIRECT, OR DIRECT DAMAGES, HOWEVER CAUSED AND ON ANY
80+
THEORY OF LIABILITY, ARISING OUT OF THIS AGREEMENT.  THE FOREGOING SHALL
81+
APPLY TO THE EXTENT PERMITTED BY APPLICABLE LAW.
82+
83+
6.GENERAL.
84+
85+
6.1 Governing Law. This Agreement will be governed by and interpreted in
86+
accordance with the laws of the state of California, without reference to
87+
its conflict of laws principles.  If Licensee is located within the
88+
United States, all disputes arising out of this Agreement are subject to
89+
the exclusive jurisdiction of courts located in San Francisco County,
90+
California. USA.  If Licensee is located outside of the United States,
91+
any dispute, controversy or claim arising out of or relating to this
92+
Agreement will be referred to and finally determined by arbitration in
93+
accordance with the JAMS International Arbitration Rules.  The tribunal
94+
will consist of one arbitrator. The place of arbitration will be San
95+
Francisco, California. The language to be used in the arbitral proceedings
96+
will be English. Judgment upon the award rendered by the arbitrator may
97+
be entered in any court having jurisdiction thereof.
98+
99+
6.2 Assignment.  Licensee is not authorized to assign its rights under
100+
this Agreement to any third party. Traceable may freely assign its rights
101+
under this Agreement to any third party.
102+
103+
6.3 Other.  This Agreement is the entire agreement between the parties
104+
regarding the subject matter hereof.  No amendment or modification of
105+
this Agreement will be valid or binding upon the parties unless made in
106+
writing and signed by the duly authorized representatives of both
107+
parties.  In the event that any provision, including without limitation
108+
any condition, of this Agreement is held to be unenforceable, this
109+
Agreement and all licenses and rights granted hereunder will immediately
110+
terminate.  Waiver by Traceable of a breach of any provision of this
111+
Agreement or the failure by Traceable to exercise any right hereunder
112+
will not be construed as a waiver of any subsequent breach of that right
113+
or as a waiver of any other right.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## Config Service

buf.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
build:
2+
roots:
3+
- config-service-api/src/main/proto
4+
lint:
5+
use:
6+
- DEFAULT
7+
breaking:
8+
use:
9+
- PACKAGE
10+
- WIRE_JSON

build.gradle.kts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
plugins {
2+
id("org.hypertrace.repository-plugin") version "0.1.2"
3+
id("org.hypertrace.ci-utils-plugin") version "0.1.1"
4+
id("org.hypertrace.jacoco-report-plugin") version "0.1.0" apply false
5+
id("org.hypertrace.publish-plugin") version "0.3.0" apply false
6+
id("org.hypertrace.docker-java-application-plugin") version "0.8.0" apply false
7+
id("org.hypertrace.docker-publish-plugin") version "0.8.0" apply false
8+
id("org.hypertrace.integration-test-plugin") version "0.1.0" apply false
9+
}
10+
11+
subprojects {
12+
group = "org.hypertrace.config.service"
13+
pluginManager.withPlugin("org.hypertrace.publish-plugin") {
14+
configure<org.hypertrace.gradle.publishing.HypertracePublishExtension> {
15+
license.set(org.hypertrace.gradle.publishing.License.TRACEABLE_COMMUNITY)
16+
}
17+
}
18+
19+
pluginManager.withPlugin("java") {
20+
configure<JavaPluginExtension> {
21+
sourceCompatibility = JavaVersion.VERSION_11
22+
targetCompatibility = JavaVersion.VERSION_11
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)