Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Run Forseti in Docker on Kubernetes or Container-Optimized OS (Proof of Concept) #2335

Merged
merged 14 commits into from
Feb 28, 2019

Conversation

angelsungoogle
Copy link
Contributor

@angelsungoogle angelsungoogle commented Dec 3, 2018

Many thanks to @Red-Five for pulling up these changes and fixes! Please feel free to contribute.

@andreyk-code is Kubernetes subject matter expert and will the peer reviewer for @Red-Five work here.

Thanks for opening a Pull Request!

Here's a handy checklist to ensure your PR goes smoothly.

  • I signed Google's Contributor License Agreement
  • My code conforms to Google's python style.
  • My PR at a minimum doesn't decrease unit-test coverage (if applicable).
  • My PR has been functionally tested.
  • All of the unit-tests still pass.
  • Running pylint --rcfile=pylintrc passes.

These guidelines and more can be found in our contributing guidelines.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@angelsungoogle angelsungoogle self-assigned this Dec 3, 2018
@blueandgold
Copy link
Contributor

@angelsungoogle Can you please make sure that you have sign the CLA and that you have configured your github env to use the correct email? I will follow-up with you offline about this, in more detail.

@Red-Five
Copy link
Contributor

Red-Five commented Dec 3, 2018

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Confirming that I would like my initial changes merged into the docker-poc branch.

Kubernetes (GKE) files will be added shortly.

@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

@Red-Five
Copy link
Contributor

Red-Five commented Dec 3, 2018

@angelsungoogle This pull request is to dev. I thought we were going to keep a separate docker-poc branch for now? I'm OK either way, however you think best.

@angelsungoogle
Copy link
Contributor Author

angelsungoogle commented Dec 3, 2018

@Red-Five we do have a separate branch docker-poc, which is the branch this PR is based on. For collaboration, people could continue to push to the docker-poc branch. I'm just keeping a PR here, so that docker related issues could refer to this PR for changes, and we have a summary view of what's changed compared to dev, since eventually our goal is to merge this in when we are ready

@angelsungoogle
Copy link
Contributor Author

the docker poc branch

@Red-Five
Copy link
Contributor

Red-Five commented Dec 3, 2018

Forseti Server Tasks

  • cloudbuild.yaml file path fix
  • cloudbuild.yaml unittest step
  • base dockerfile Google SDK Install
  • Add docker_entrypoint.sh
  • docker_entrypoint.sh: add var to toggle debugging
  • docker_entrypoint.sh: add var to control which services to run in container
  • Kubernetes CronJob Deployment file
  • Kubernetes Services Deployment file
  • Script to spin up GKE cluster, add credential secret and deploy app.
  • Server on Container Optimized OS (cos)
  • Cron job on Container Optimized OS (cos)
  • Cron job on long running GKE server
  • Supporting documentation in Docker FAQ

Forseti Client Tasks

  • GKE Deployment File

* Add Docker entrypoint script to start Forseti Server in a container

* Merge all docker related changes to this branch.

* Fix entrypoint filename

* Add.dockerignore

* Update docker_entrpoint.sh comments and forseti dockerfile comments.

* Update docker_entrpoint.sh Add new line at end of file.

* Update docker_entrypoint.sh

Add gsutil -DD debug flag

* Update docker_entrypoint.sh

Set forseti server log level to debug

* Update docker_entrypoint.sh

Remove & from forseti server command. Don't run it as background task.

* Add poc k8s_setup_forseti.sh and forseti.template.yaml

* Update comment in k8s_setup_forseti.sh

* Update k8s_setup_forseti.sh

* Add cos_setup_forseti.sh for proof of concept

* Updated k8s_setup_forseti.sh, added newline at end of file

* Update docker_entrypoint.sh

Modified comments

* Update .dockerignore. Added .git and .dockerignore entries.

* Update to enable CronJob on k8s

* Fix last line in k8s_setup_forseti.sh

* wait 60s after starting server before running rest of job

* Wait 60s after starting service to allow for it to fully start

* Update forseti.template.yaml

* docker_entrypoint.sh Wait 10s after servers start
forseti.template.yaml Cloud SQL v1.13, never allow concurrent cronjob

* Cloud SQL latest tag. Remove debugging.

* Fix cloud sql connection string

* Run forseti server as a background task

* Temporarily add set -x for debugging

* Modify forseti notifier run call

* Refactor Cloud SQL Proxy to run as k8s service instead of a sidecar

* Refactor Cloud SQL Proxy as k8s service instead of sidecar

* Update comment

* Use k8s env vars for Cloud SQL

* Fix Cloud SQL connection string for Service
@codecov
Copy link

codecov bot commented Dec 14, 2018

Codecov Report

Merging #2335 into dev will increase coverage by 0.11%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              dev    #2335      +/-   ##
==========================================
+ Coverage   88.55%   88.67%   +0.11%     
==========================================
  Files         180      180              
  Lines       14073    13991      -82     
==========================================
- Hits        12463    12406      -57     
+ Misses       1610     1585      -25
Impacted Files Coverage Δ
...d/forseti/scanner/scanners/enabled_apis_scanner.py 84.61% <0%> (-4.97%) ⬇️
google/cloud/forseti/scanner/scanner_builder.py 86.95% <0%> (-2.33%) ⬇️
...loud/forseti/scanner/scanners/iam_rules_scanner.py 77.89% <0%> (-2.33%) ⬇️
.../cloud/forseti/services/model/importer/importer.py 91.35% <0%> (-0.31%) ⬇️
google/cloud/forseti/scanner/scanner.py 90.56% <0%> (-0.18%) ⬇️
...canner/scanners/external_project_access_scanner.py 86.59% <0%> (-0.14%) ⬇️
google/cloud/forseti/services/cli.py 85.4% <0%> (-0.12%) ⬇️
google/cloud/forseti/services/client.py 77.72% <0%> (ø) ⬆️
...cloud/forseti/services/inventory/base/resources.py 85.93% <0%> (+0.19%) ⬆️
...oogle/cloud/forseti/services/inventory/base/gcp.py 96.7% <0%> (+0.22%) ⬆️
... and 7 more

@codecov
Copy link

codecov bot commented Dec 14, 2018

Codecov Report

Merging #2335 into dev will decrease coverage by 0.11%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              dev    #2335      +/-   ##
==========================================
- Coverage   88.55%   88.44%   -0.12%     
==========================================
  Files         180      194      +14     
  Lines       14073    14640     +567     
==========================================
+ Hits        12463    12949     +486     
- Misses       1610     1691      +81
Impacted Files Coverage Δ
...d/forseti/scanner/scanners/enabled_apis_scanner.py 84.61% <0%> (-4.97%) ⬇️
google/cloud/forseti/scanner/scanner_builder.py 86.95% <0%> (-2.33%) ⬇️
...loud/forseti/scanner/scanners/iam_rules_scanner.py 77.89% <0%> (-2.33%) ⬇️
.../cloud/forseti/services/model/importer/importer.py 91.35% <0%> (-0.31%) ⬇️
google/cloud/forseti/scanner/scanner.py 90.56% <0%> (-0.18%) ⬇️
...canner/scanners/external_project_access_scanner.py 86.59% <0%> (-0.14%) ⬇️
google/cloud/forseti/services/cli.py 85.4% <0%> (-0.12%) ⬇️
google/cloud/forseti/services/client.py 77.72% <0%> (ø) ⬆️
...cloud/forseti/services/server_config/server_pb2.py 100% <0%> (ø)
...ogle/cloud/forseti/services/explain/explain_pb2.py 100% <0%> (ø)
... and 21 more

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

@Red-Five
Copy link
Contributor

Red-Five commented Dec 21, 2018

The next steps will likely be to make a forseti.service.template.yaml following the GKE Service Tutorial, and add something like a if statement here

Very rough draft, not ready yet: #2440

@angelsungoogle
Copy link
Contributor Author

Thanks Duncan!
@blueandgold our favorite client has just done the work for us, right before Christmas XD

@Red-Five
Copy link
Contributor

Red-Five commented Jan 10, 2019

This might be worth looking into. https://cloud.google.com/knative/

@angelsungoogle
Copy link
Contributor Author

@blueandgold

* Add Docker entrypoint script to start Forseti Server in a container

* Merge all docker related changes to this branch.

* Fix entrypoint filename

* Add.dockerignore

* Update docker_entrpoint.sh comments and forseti dockerfile comments.

* Update docker_entrpoint.sh Add new line at end of file.

* Update docker_entrypoint.sh

Add gsutil -DD debug flag

* Update docker_entrypoint.sh

Set forseti server log level to debug

* Update docker_entrypoint.sh

Remove & from forseti server command. Don't run it as background task.

* Add poc k8s_setup_forseti.sh and forseti.template.yaml

* Update comment in k8s_setup_forseti.sh

* Update k8s_setup_forseti.sh

* Add cos_setup_forseti.sh for proof of concept

* Updated k8s_setup_forseti.sh, added newline at end of file

* Update docker_entrypoint.sh

Modified comments

* Update .dockerignore. Added .git and .dockerignore entries.

* Update to enable CronJob on k8s

* Fix last line in k8s_setup_forseti.sh

* wait 60s after starting server before running rest of job

* Wait 60s after starting service to allow for it to fully start

* Update forseti.template.yaml

* docker_entrypoint.sh Wait 10s after servers start
forseti.template.yaml Cloud SQL v1.13, never allow concurrent cronjob

* Cloud SQL latest tag. Remove debugging.

* Fix cloud sql connection string

* Run forseti server as a background task

* Temporarily add set -x for debugging

* Modify forseti notifier run call

* Refactor Cloud SQL Proxy to run as k8s service instead of a sidecar

* Refactor Cloud SQL Proxy as k8s service instead of sidecar

* Update comment

* Use k8s env vars for Cloud SQL

* Fix Cloud SQL connection string for Service

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh
Refactor forseti.template.yaml

* Refactor forseti.template.yaml

* Refactor forseti.template.yaml

* Refactor forseti.template.yaml

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* cloudbuild.yaml cache base image to speed up builds

* cloudbuild.yaml cache base image to speed up builds

* k8s-setup-forseti.sh use latest stackdriver k8s support
Change disk size

docker_entrypoint.sh fix scanner command

* cloudbuild.yaml cache base image

* Rename forseti.template.yaml to forseti.cronjob.template.yaml

* Comment change

* docker_entrypoint.sh default cloud sql host and port to localhost 3306

* cos_setup_forseti.sh add --bucket

* cos_setup_forseti.sh comments

* docker_entrypoint.sh comment change

* k8s_setup_forseti.sh comment changes

* Update docker_entrypoint.sh

default RUN_CRONJOB=false

* Run forseti as a k8s Cluster IP Service

* Update usage comments.
Remove start_client, its not needed
Renamed download_configuration_files to download_server_configuration_files
Added download_client_configuration_files placeholder
Modified main accordingly

* Update usage comments.

* Turn off running server as default, set RUN_SERVER=FALSE

* Refactor variables.

* Rename forset.server.template.yaml to forseti.server.template.yaml

* k8s_setup_forseti.sh exit on error, print commands, fix if statements.

* k8s_setup_forseti.sh changed comment

* docker_entrypoint.sh modify if statements in main

* cloudbuild.yaml comment out optional unit tests step

* docker_entrpoint.sh run long lived server as foreground process, short lived cronjob as background process

* docker_entrpoint.sh run long lived server as foreground process, short lived cronjob as background process

* docker_entrpoint.sh run long lived server as foreground process, short lived cronjob as background process

* Added client_cli_setup() placeholder

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable server console log.

* Revert

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit b5ea186

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit 2fc42ae

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit 385f8f2

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit eda058f

* Temporary inventory service logging

* Temporary inventory service logging
@codecov
Copy link

codecov bot commented Feb 4, 2019

Codecov Report

Merging #2335 into dev will decrease coverage by 0.2%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              dev    #2335      +/-   ##
==========================================
- Coverage   88.62%   88.41%   -0.21%     
==========================================
  Files         189      203      +14     
  Lines       14953    15602     +649     
==========================================
+ Hits        13252    13795     +543     
- Misses       1701     1807     +106
Impacted Files Coverage Δ
...cloud/forseti/services/server_config/server_pb2.py 100% <0%> (ø)
...ogle/cloud/forseti/services/explain/explain_pb2.py 100% <0%> (ø)
google/cloud/forseti/enforcer/enforcer_log_pb2.py 100% <0%> (ø)
.../forseti/services/server_config/server_pb2_grpc.py 47.05% <0%> (ø)
...ogle/cloud/forseti/services/scanner/scanner_pb2.py 100% <0%> (ø)
google/cloud/forseti/services/model/model_pb2.py 100% <0%> (ø)
...cloud/forseti/services/scanner/scanner_pb2_grpc.py 52.63% <0%> (ø)
...d/forseti/services/inventory/inventory_pb2_grpc.py 53.84% <0%> (ø)
...le/cloud/forseti/services/notifier/notifier_pb2.py 100% <0%> (ø)
...le/cloud/forseti/enforcer/enforcer_log_pb2_grpc.py 0% <0%> (ø)
... and 4 more

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@googlebot googlebot added cla: no and removed cla: yes labels Feb 4, 2019
blueandgold and others added 2 commits February 4, 2019 12:23
* Add Docker entrypoint script to start Forseti Server in a container

* Merge all docker related changes to this branch.

* Fix entrypoint filename

* Add.dockerignore

* Update docker_entrpoint.sh comments and forseti dockerfile comments.

* Update docker_entrpoint.sh Add new line at end of file.

* Update docker_entrypoint.sh

Add gsutil -DD debug flag

* Update docker_entrypoint.sh

Set forseti server log level to debug

* Update docker_entrypoint.sh

Remove & from forseti server command. Don't run it as background task.

* Add poc k8s_setup_forseti.sh and forseti.template.yaml

* Update comment in k8s_setup_forseti.sh

* Update k8s_setup_forseti.sh

* Add cos_setup_forseti.sh for proof of concept

* Updated k8s_setup_forseti.sh, added newline at end of file

* Update docker_entrypoint.sh

Modified comments

* Update .dockerignore. Added .git and .dockerignore entries.

* Update to enable CronJob on k8s

* Fix last line in k8s_setup_forseti.sh

* wait 60s after starting server before running rest of job

* Wait 60s after starting service to allow for it to fully start

* Update forseti.template.yaml

* docker_entrypoint.sh Wait 10s after servers start
forseti.template.yaml Cloud SQL v1.13, never allow concurrent cronjob

* Cloud SQL latest tag. Remove debugging.

* Fix cloud sql connection string

* Run forseti server as a background task

* Temporarily add set -x for debugging

* Modify forseti notifier run call

* Refactor Cloud SQL Proxy to run as k8s service instead of a sidecar

* Refactor Cloud SQL Proxy as k8s service instead of sidecar

* Update comment

* Use k8s env vars for Cloud SQL

* Fix Cloud SQL connection string for Service

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh
Refactor forseti.template.yaml

* Refactor forseti.template.yaml

* Refactor forseti.template.yaml

* Refactor forseti.template.yaml

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* cloudbuild.yaml cache base image to speed up builds

* cloudbuild.yaml cache base image to speed up builds

* k8s-setup-forseti.sh use latest stackdriver k8s support
Change disk size

docker_entrypoint.sh fix scanner command

* cloudbuild.yaml cache base image

* Rename forseti.template.yaml to forseti.cronjob.template.yaml

* Comment change

* docker_entrypoint.sh default cloud sql host and port to localhost 3306

* cos_setup_forseti.sh add --bucket

* cos_setup_forseti.sh comments

* docker_entrypoint.sh comment change

* k8s_setup_forseti.sh comment changes

* Update docker_entrypoint.sh

default RUN_CRONJOB=false

* Run forseti as a k8s Cluster IP Service

* Update usage comments.
Remove start_client, its not needed
Renamed download_configuration_files to download_server_configuration_files
Added download_client_configuration_files placeholder
Modified main accordingly

* Update usage comments.

* Turn off running server as default, set RUN_SERVER=FALSE

* Refactor variables.

* Rename forset.server.template.yaml to forseti.server.template.yaml

* k8s_setup_forseti.sh exit on error, print commands, fix if statements.

* k8s_setup_forseti.sh changed comment

* docker_entrypoint.sh modify if statements in main

* cloudbuild.yaml comment out optional unit tests step

* docker_entrpoint.sh run long lived server as foreground process, short lived cronjob as background process

* docker_entrpoint.sh run long lived server as foreground process, short lived cronjob as background process

* docker_entrpoint.sh run long lived server as foreground process, short lived cronjob as background process

* Added client_cli_setup() placeholder

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable server console log.

* Revert

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit b5ea186

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit 2fc42ae

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit 385f8f2

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit eda058f

* Temporary inventory service logging

* Temporary inventory service logging

* enable server console log

* Cloud build cache step updates.

* grpc issue investigation

* Code style fix

* Remove temporary logging code
@Red-Five
Copy link
Contributor

Red-Five commented Feb 27, 2019

Pending merge of PR #2590

Red-Five and others added 2 commits February 27, 2019 13:02
* Add Docker entrypoint script to start Forseti Server in a container

* Merge all docker related changes to this branch.

* Fix entrypoint filename

* Add.dockerignore

* Update docker_entrpoint.sh comments and forseti dockerfile comments.

* Update docker_entrpoint.sh Add new line at end of file.

* Update docker_entrypoint.sh

Add gsutil -DD debug flag

* Update docker_entrypoint.sh

Set forseti server log level to debug

* Update docker_entrypoint.sh

Remove & from forseti server command. Don't run it as background task.

* Add poc k8s_setup_forseti.sh and forseti.template.yaml

* Update comment in k8s_setup_forseti.sh

* Update k8s_setup_forseti.sh

* Add cos_setup_forseti.sh for proof of concept

* Updated k8s_setup_forseti.sh, added newline at end of file

* Update docker_entrypoint.sh

Modified comments

* Update .dockerignore. Added .git and .dockerignore entries.

* Update to enable CronJob on k8s

* Fix last line in k8s_setup_forseti.sh

* wait 60s after starting server before running rest of job

* Wait 60s after starting service to allow for it to fully start

* Update forseti.template.yaml

* docker_entrypoint.sh Wait 10s after servers start
forseti.template.yaml Cloud SQL v1.13, never allow concurrent cronjob

* Cloud SQL latest tag. Remove debugging.

* Fix cloud sql connection string

* Run forseti server as a background task

* Temporarily add set -x for debugging

* Modify forseti notifier run call

* Refactor Cloud SQL Proxy to run as k8s service instead of a sidecar

* Refactor Cloud SQL Proxy as k8s service instead of sidecar

* Update comment

* Use k8s env vars for Cloud SQL

* Fix Cloud SQL connection string for Service

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh
Refactor forseti.template.yaml

* Refactor forseti.template.yaml

* Refactor forseti.template.yaml

* Refactor forseti.template.yaml

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* Refactor docker_entrypoint.sh

* cloudbuild.yaml cache base image to speed up builds

* cloudbuild.yaml cache base image to speed up builds

* k8s-setup-forseti.sh use latest stackdriver k8s support
Change disk size

docker_entrypoint.sh fix scanner command

* cloudbuild.yaml cache base image

* Rename forseti.template.yaml to forseti.cronjob.template.yaml

* Comment change

* docker_entrypoint.sh default cloud sql host and port to localhost 3306

* cos_setup_forseti.sh add --bucket

* cos_setup_forseti.sh comments

* docker_entrypoint.sh comment change

* k8s_setup_forseti.sh comment changes

* Update docker_entrypoint.sh

default RUN_CRONJOB=false

* Run forseti as a k8s Cluster IP Service

* Update usage comments.
Remove start_client, its not needed
Renamed download_configuration_files to download_server_configuration_files
Added download_client_configuration_files placeholder
Modified main accordingly

* Update usage comments.

* Turn off running server as default, set RUN_SERVER=FALSE

* Refactor variables.

* Rename forset.server.template.yaml to forseti.server.template.yaml

* k8s_setup_forseti.sh exit on error, print commands, fix if statements.

* k8s_setup_forseti.sh changed comment

* docker_entrypoint.sh modify if statements in main

* cloudbuild.yaml comment out optional unit tests step

* docker_entrpoint.sh run long lived server as foreground process, short lived cronjob as background process

* docker_entrpoint.sh run long lived server as foreground process, short lived cronjob as background process

* docker_entrpoint.sh run long lived server as foreground process, short lived cronjob as background process

* Added client_cli_setup() placeholder

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Client CLI container code

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable StackDriver debugger. Do merge into upstream.

* Temporarily enable server console log.

* Revert

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit b5ea186

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit 2fc42ae

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit 385f8f2

* Revert "Temporarily enable StackDriver debugger. Do merge into upstream."

This reverts commit eda058f

* Temporary inventory service logging

* Temporary inventory service logging

* enable server console log

* Cloud build cache step updates.

* grpc issue investigation

* Code style fix

* Remove temporary logging code

* Update forseti.cronjob.template.yaml
Change secretName

* Update cloudbuild.yaml
Comment out base image cache step.

* Set allowPrivilegeEscalation: false

* Update k8s_setup_forseti.sh
Minor comment and formatting changes

* Update apt_packages.txt
Add cron to support running cronjobs in Docker container.

* Update forset.cronjob.template.yaml
Remove explain from list of services as its not used in k8s cronjobs

* Changes to support both k8s and docker versions of cronjob

* Update docker_entrypoint.sh
Create env file needed for run_forseti.sh
Call run_forseti.sh to execute the cronjob code

* Update cloudbuild.yaml comment out additional cache lines

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update forseti.server.template.yaml
Fix cmd args.

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Update docker_entrypoint.sh
Continuation: Code for creating server env file

* Rename client key file

* Add disk type option

* Try a workaround for the env setup issue.

* Added flag to optionally create cluster

* Run server as background process if running as k8s CronJob or Docker based cron process is running in the same container

* Docker cronjob support

* Docker cronjob support

* Docker cronjob support

* Docker cronjob support

* Docker cronjob support

* Docker cronjob support

* Docker cronjob support

* Docker cronjob support

* Cache base image

* Cache base image

* Cache base image

* allowPrivilegeEscalation: false in all k8s deployment templates

* Source client env script in .bashrc
Copy link
Contributor

@blueandgold blueandgold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for pulling all these together! Please ack the CLA one more time.

Copy link
Contributor

@Red-Five Red-Five left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have signed CLA and agree to all these changes going into dev branch.

# Install the CloudSDK for `gcloud`.
RUN curl -sSL https://sdk.cloud.google.com 1> /dev/null | bash
# Install Google Cloud SDK
RUN curl -sSL https://sdk.cloud.google.com | bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to install Google Cloud SDK so that it doesn't require root to use it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run chmod or chown?

@blueandgold blueandgold changed the title Docker Proof of Concept (Collaboration Welcomed!) Run Forseti in Docker on Kubernetes or Container-Optimized OS (Proof of Concept) Feb 27, 2019
@blueandgold
Copy link
Contributor

Adding cla: yes label, as all commit authors have contributed to this project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants