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

Deploy Aggregator on GCP #705

Merged
merged 5 commits into from
Mar 19, 2020
Merged

Conversation

ipetr0v
Copy link
Contributor

@ipetr0v ipetr0v commented Mar 17, 2020

This change adds a ./examples/aggregator/scripts directory that contains scripts for Google Cloud deployment using Kubernetes.

Fixes #693

Checklist

  • Pull request affects core Oak functionality (e.g. runtime, SDK, ABI)
    • I have written tests that cover the code changes.
    • I have checked that these tests are run by Cloudbuild
    • I have updated documentation accordingly.
    • I have raised an issue to
      cover any TODOs and/or unfinished work.
  • Pull request includes prototype/experimental work that is under
    construction.

examples/aggregator/gcp/pod.yaml Outdated Show resolved Hide resolved
examples/aggregator/gcp/pod.yaml Show resolved Hide resolved
examples/aggregator/scripts/docker_push Outdated Show resolved Hide resolved
examples/aggregator/README.md Outdated Show resolved Hide resolved
examples/aggregator/scripts/deploy Outdated Show resolved Hide resolved
fi

# Push Oak application server Docker image.
docker load -i "./${IMAGES:1}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the :1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that not needed now? What if IMAGES returns more than one? I was just asking, not suggesting to remove it.

Copy link
Contributor Author

@ipetr0v ipetr0v Mar 19, 2020

Choose a reason for hiding this comment

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

I deleted it after checking that there is only one directory with this file.
Previously I had multiple - not I think I had them because I changed the output dir.
I think I'll just add a check+error that there a more that one aggregator.tar files, since there can be only one.

readonly AGGREGATOR_DOCKER_IMAGE_NAME='gcr.io/oak-ci/oak-aggregator'
readonly BACKEND_DOCKER_IMAGE_NAME='gcr.io/oak-ci/oak-aggregator-backend'

readonly IMAGES="$(find ./bazel-cache -name aggregator_image.tar)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems a very crude way to find those images. Can they not be found under a specific path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This path depends on the username:

"./bazel-cache/_bazel_${USERNAME}/b6bc0828d5b43c7085b650e0698bf388/execroot/oak/bazel-out/k8-dbg/bin/examples/aggregator/server/aggregator_image.tar"

Copy link
Collaborator

Choose a reason for hiding this comment

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

But why are they not under bazel-out or bazel-bin or some other variation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

$ find . -name 'aggregator_*.tar'                                                                                     1 ↵ 
./bazel-cache/_bazel_ivanpetrov/b6bc0828d5b43c7085b650e0698bf388/execroot/oak/bazel-out/k8-dbg/bin/examples/aggregator/server/aggregator_image.tar
./bazel-cache/_bazel_ivanpetrov/b6bc0828d5b43c7085b650e0698bf388/execroot/oak/bazel-out/k8-dbg/bin/examples/aggregator/server/aggregator_image-layer.tar
./bazel-cache/_bazel_ivanpetrov/b6bc0828d5b43c7085b650e0698bf388/execroot/oak/bazel-out/k8-fastbuild/bin/examples/aggregator/server/aggregator_backend_image-layer.tar
./bazel-cache/_bazel_ivanpetrov/b6bc0828d5b43c7085b650e0698bf388/execroot/oak/bazel-out/k8-fastbuild/bin/examples/aggregator/server/aggregator_backend_image.tar

Copy link
Contributor Author

@ipetr0v ipetr0v Mar 19, 2020

Choose a reason for hiding this comment

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

bazel-bin is only available inside Docker.
And it's now only possible to push Docker image outside the dev Docker.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it should be possible to copy things out from bazel-bin to another output directory, while running in Docker? That seems cleaner than just looking around in the bazel cache.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I agree
So we need a new temporary directory for this. And we probably need to always check that this directory is cleared, once something like bazel clean is running.
Is it possible to use target directory for this? Or it's better to keep it only for rust?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps go ahead with this PR as it is for now, but create a separate issue to track copying artefacts to an output directory (can just be called out, and git-ignored). We can then copy Rust binaries, wasm files, Docker images, Oak applications and anything else in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created an issue #719

@ipetr0v ipetr0v requested a review from tiziano88 March 19, 2020 14:06
@ipetr0v ipetr0v merged commit 662d85f into project-oak:master Mar 19, 2020
@ipetr0v ipetr0v deleted the example_deployment branch March 19, 2020 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deploy Oak application to GCP
3 participants