Skip to content

Commit db25434

Browse files
authored
Merge pull request #230 from mozilla/support-gcs
Add support for writing to GCS
2 parents 7352667 + 4250168 commit db25434

File tree

7 files changed

+540
-43
lines changed

7 files changed

+540
-43
lines changed

.circleci/config.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
version: 2.1
2+
orbs:
3+
gcp-gcr: circleci/[email protected]
4+
jobs:
5+
build:
6+
docker: &docker
7+
- image: cimg/node:10.18.1
8+
steps:
9+
- checkout
10+
- &setup_docker_with_caching
11+
setup_remote_docker:
12+
docker_layer_caching: true
13+
- run:
14+
name: Build Image
15+
command: |
16+
make build
17+
test:
18+
docker: *docker
19+
steps:
20+
- checkout
21+
- *setup_docker_with_caching
22+
- run:
23+
name: Run unit tests
24+
command: |
25+
touch .env
26+
make test
27+
lint:
28+
docker: *docker
29+
steps:
30+
- checkout
31+
- *setup_docker_with_caching
32+
- run:
33+
name: Check code formatting
34+
command: |
35+
make lint
36+
deploy:
37+
docker: *docker
38+
steps:
39+
- checkout
40+
- *setup_docker_with_caching
41+
- gcp-gcr/gcr-auth
42+
- gcp-gcr/build-image: &private-image
43+
image: ensemble-transposer
44+
tag: ${CIRCLE_TAG:-latest}
45+
- gcp-gcr/push-image: *private-image
46+
workflows:
47+
version: 2
48+
ci_workflow:
49+
jobs: &build_jobs
50+
- build:
51+
context: data-eng-circleci-tests
52+
- test:
53+
requires:
54+
- build
55+
- lint:
56+
requires:
57+
- build
58+
- deploy:
59+
context: data-eng-airflow-gcr
60+
filters:
61+
branches:
62+
only: main
63+
tags:
64+
only: /.*/
65+
requires:
66+
- build
67+
- test
68+
- lint

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88
node_modules
99
npm-debug.log*
1010
*.log
11+
12+
# output
13+
target

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ code, for example.
6868

6969
## Deployment
7070

71-
This project is meant to be run as a cloud task, like a Lambda function or
71+
### AWS
72+
73+
This project was originally meant to be run as a cloud task, like a Lambda function or
7274
Google Cloud Function. The main function is specified as the value of `main` in
7375
*package.json*. Most services read this value and do the right thing. If not,
7476
you may need to manually point your service to that function.
@@ -82,6 +84,20 @@ variables:
8284
* `AWS_ACCESS_KEY_ID`
8385
* `AWS_SECRET_ACCESS_KEY`
8486

87+
### Google Cloud
88+
89+
This project can be run as a Docker container. The default command is `npm start`, but it may need
90+
to be explicitly configured in some environments. When running the container in GKE, authentication
91+
will be automatically detected. Before running, be sure to create a [Google Cloud
92+
Storage](https://cloud.google.com/storage) bucket and set the following environment variable:
93+
94+
* `GCS_BUCKET_NAME`
95+
96+
### Other
97+
98+
When neither `AWS_BUCKET_NAME` nor `GCS_BUCKET_NAME` are present in the environment, this project
99+
will write data to `./target`, which can then be copied to otherwise unsupported systems.
100+
85101
## Notes
86102

87103
### Versioning

0 commit comments

Comments
 (0)