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

Start outline of documentation updates for running on GCP #2

Merged
merged 3 commits into from
Oct 24, 2023

Conversation

nweires
Copy link
Collaborator

@nweires nweires commented Oct 20, 2023

Create section headers and TODOs for adding docs, so we can fill them in as we work in the implementation.

@nweires nweires requested a review from lathanh October 20, 2023 14:14
~~~~~~~~~~~~~~~~~~~~~

TODO: Add any GCP-specific installation instructions
TODO: Need to install and run docker?
Copy link
Member

Choose a reason for hiding this comment

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

FYI, yes, you need to install Docker. Installation automatically starts the service; you shouldn't need to explicitly start/run anything.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, that's what I thought - that's also true for the AWS version, right? Even though that's not in the instructions?

Copy link
Member

Choose a reason for hiding this comment

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

correct

Google Cloud Platform
~~~~~~~~~~~~~~~~~~~~~

TODO: Add any GCP-specific installation instructions
Copy link
Member

Choose a reason for hiding this comment

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

FYI, on the client side (workstation where you run the script), there's no GCP stuff to "install." You do need to setup the GOOGLE_APPLICATION_CREDENTIALS key. There is setup to do on the GCP side (like creating a repository).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I think the basic "you need a GCP project and the appropriate credentials" stuff can go here, similar to the AWS section above. (This reminds me that we'll also need to make sure to update setup.py to include any python packages we're using.)

I'm hoping all the GCP-side setup can be done automatically, via Terraform.

Copy link
Member

Choose a reason for hiding this comment

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

This reminds me that we'll also need to make sure to update setup.py to include any python packages we're using.

Yea, earlier revisions of my work added 'google-api-python-client' and 'google-cloud-storage' to 'install_requires', but I ended up not needing those since interaction with GCP's Artifact Registry went through the Docker Client (and use of Docker standard APIs with AR).

Comment on lines +135 to +142
gcp_project: myorg_project
region: us-central1
artifact_registry: buildstockbatch
gcs:
bucket: mybucket
prefix: national01_run01
use_spot: true
batch_array_size: 10000
Copy link
Member

Choose a reason for hiding this comment

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

To reflect the current state of the schema:

  • gcp_projectproject
  • no gcs nor use_spot

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Those changes are in the PR I'm about to send! Sorry they're out of order - I pulled these changes out of that branch.

(I'm using gcp_project to distinguish it from the BSB "project" that's being run.)

Comment on lines +159 to +160
When the simulation and postprocessing is all complete, run ``buildstock_gcp
--clean your_project_file.yml``. This will clean up all the GCP resources that
Copy link
Member

Choose a reason for hiding this comment

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

This is somewhat inaccurate (for lack of better word) for the version that we're developing since doing a run now also includes cleanup (i.e., you don't usually need to run cleanup separately). So, this should probably start with something more like: "Running a simulation automatically cleans up GCP resources when it completes. If you need to clean up manually (e.g., because the run did not complete) or cancel a run, run buildstock_gcp --clean your_project_file.yml..."

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure that will stay true for all resources (for example, nothing is deleting the docker image you're uploading), but I'll add a TODO for now to make sure it's accurate when we actually implement this option.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, also, to clarify, my code for the GCP Batch job just kicks off the job, then exits. So the current code

batch.run_batch()
batch.process_results()
batch.clean()

won't actually work correctly, since cleanup needs to wait until the job actually finishes.

And since these jobs may take hours to run, I think that's the right model - the user shouldn't have to have to leave a script running locally for that long.

@lathanh lathanh added the documentation Improvements or additions to documentation label Oct 20, 2023
See :ref:`gcp-config` for details.


List existing jobs
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This feature is coming soon in another PR.

Google Cloud Platform
~~~~~~~~~~~~~~~~~~~~~

TODO: Add any GCP-specific installation instructions
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I think the basic "you need a GCP project and the appropriate credentials" stuff can go here, similar to the AWS section above. (This reminds me that we'll also need to make sure to update setup.py to include any python packages we're using.)

I'm hoping all the GCP-side setup can be done automatically, via Terraform.

~~~~~~~~~~~~~~~~~~~~~

TODO: Add any GCP-specific installation instructions
TODO: Need to install and run docker?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, that's what I thought - that's also true for the AWS version, right? Even though that's not in the instructions?

Comment on lines +135 to +142
gcp_project: myorg_project
region: us-central1
artifact_registry: buildstockbatch
gcs:
bucket: mybucket
prefix: national01_run01
use_spot: true
batch_array_size: 10000
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Those changes are in the PR I'm about to send! Sorry they're out of order - I pulled these changes out of that branch.

(I'm using gcp_project to distinguish it from the BSB "project" that's being run.)

Comment on lines +159 to +160
When the simulation and postprocessing is all complete, run ``buildstock_gcp
--clean your_project_file.yml``. This will clean up all the GCP resources that
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure that will stay true for all resources (for example, nothing is deleting the docker image you're uploading), but I'll add a TODO for now to make sure it's accurate when we actually implement this option.

@nweires nweires requested a review from lathanh October 23, 2023 13:57
@nweires nweires merged commit 2cbb454 into gcp Oct 24, 2023
@nweires nweires deleted the natalie/gcp_docs branch October 24, 2023 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants