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

Move GCP networking + pricing logic out of cloud provider #614

Merged
merged 19 commits into from
Nov 4, 2022

Conversation

parasj
Copy link
Contributor

@parasj parasj commented Oct 18, 2022

Changes:

  • Move pricing logic to GCPPricing
  • Move GCP networking logic to GCPNetwork
  • Shift firewall rules to apply to a single VPC more cleanly
  • Move key management logic to GCPKeyManager

@parasj parasj self-assigned this Oct 18, 2022
@parasj parasj marked this pull request as ready for review October 21, 2022 18:03
@sarahwooders
Copy link
Contributor

I ran the command:

skyplane cp -r s3://imagenet-bucket gs://test-bucket-sarah

But got the error:

16:55:36 [WARN]  Bucket location imagenet-bucket is not public. Assuming region is us-east-1.
⠹ Querying objects in imagenet-bucket16:55:39 [WARN]  Bucket location imagenet-bucket is not public. Assuming region is us-east-1.

Will transfer 1153 objects totaling 143.41GB from aws:us-east-1 to gcp:us-east1-b
    VMs to provision: 1x aws:us-east-1, 1x gcp:us-east1-b
    Estimated egress cost: $12.91 at $0.09/GB
    synset_labels.txt => synset_labels.txt
    train-00000-of-01024 => train-00000-of-01024
    train-00001-of-01024 => train-00001-of-01024
    train-00002-of-01024 => train-00002-of-01024
    ...
    validation-00124-of-00128 => validation-00124-of-00128
    validation-00125-of-00128 => validation-00125-of-00128
    validation-00126-of-00128 => validation-00126-of-00128
    validation-00127-of-00128 => validation-00127-of-00128
Continue? [Y/n]: Y
Transfer starting (Tip: Enable auto-confirmation with `skyplane config set autoconfirm true`)

Storing debug information for transfer in /tmp/skyplane/transfer_logs/20221023_165542/client.log
⠸ Initializing cloud keys ━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/3 0:00:0116:55:44 [ERROR] Error running <lambda>: <HttpError 400 when requesting
https://compute.googleapis.com/compute/v1/projects/skyplane-sarah/global/firewalls?alt=json returned "Invalid
value for field 'resource.network': 'skyplane'. The URL is malformed.". Details: "[{'message': "Invalid value
for field 'resource.network': 'skyplane'. The URL is malformed.", 'domain': 'global', 'reason': 'invalid'},
{'message': "Invalid value for field 'resource.network': 'skyplane'. The URL is malformed.", 'domain': 'global',
'reason': 'invalid'}]">
Traceback (most recent call last):
  File "/Users/sarahwooders/repos/skyplane/skyplane/cli/cli_impl/cp_replicate.py", line 316, in
launch_replication_job
    gcp_use_spot_instances=gcp_use_spot_instances,
  File "/Users/sarahwooders/repos/skyplane/skyplane/replicate/replicator_client.py", line 191, in
provision_gateways
    do_parallel(lambda fn: fn(), jobs, spinner=True, spinner_persist=True, desc="Initializing cloud keys")
  File "/Users/sarahwooders/repos/skyplane/skyplane/utils/fn.py", line 57, in do_parallel
    args, result = future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/_base.py", line 428,
in result
    return self.__get_result()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/_base.py", line 384,
in __get_result
    raise self._exception
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py", line 57,
in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/sarahwooders/repos/skyplane/skyplane/utils/fn.py", line 46, in wrapped_fn
    raise e
  File "/Users/sarahwooders/repos/skyplane/skyplane/utils/fn.py", line 43, in wrapped_fn
    return args, func(args)
  File "/Users/sarahwooders/repos/skyplane/skyplane/replicate/replicator_client.py", line 191, in <lambda>
    do_parallel(lambda fn: fn(), jobs, spinner=True, spinner_persist=True, desc="Initializing cloud keys")
  File "/Users/sarahwooders/repos/skyplane/skyplane/compute/gcp/gcp_cloud_provider.py", line 92, in setup_global
    self.network.create_default_firewall_rules()
  File "/Users/sarahwooders/repos/skyplane/skyplane/utils/imports.py", line 33, in wrapped
    return fn(*modules_imported, *args, **kwargs)
  File "/Users/sarahwooders/repos/skyplane/skyplane/compute/gcp/gcp_network.py", line 112, in
create_default_firewall_rules
    priority=65533,
  File "/Users/sarahwooders/repos/skyplane/skyplane/utils/imports.py", line 33, in wrapped
    return fn(*modules_imported, *args, **kwargs)
  File "/Users/sarahwooders/repos/skyplane/skyplane/compute/gcp/gcp_network.py", line 89, in
create_firewall_rule
    op = compute.firewalls().insert(project=self.auth.project_id, body=body).execute()
  File "/Users/sarahwooders/repos/skyplane/env/lib/python3.7/site-packages/googleapiclient/_helpers.py", line
130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Users/sarahwooders/repos/skyplane/env/lib/python3.7/site-packages/googleapiclient/http.py", line 938,
in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting
https://compute.googleapis.com/compute/v1/projects/skyplane-sarah/global/firewalls?alt=json returned "Invalid
value for field 'resource.network': 'skyplane'. The URL is malformed.". Details: "[{'message': "Invalid value
for field 'resource.network': 'skyplane'. The URL is malformed.", 'domain': 'global', 'reason': 'invalid'},
{'message': "Invalid value for field 'resource.network': 'skyplane'. The URL is malformed.", 'domain': 'global',
'reason': 'invalid'}]">

<HttpError 400 when requesting
https://compute.googleapis.com/compute/v1/projects/skyplane-sarah/global/firewalls?alt=json returned "Invalid
value for field 'resource.network': 'skyplane'. The URL is malformed.". Details: "[{'message': "Invalid value
for field 'resource.network': 'skyplane'. The URL is malformed.", 'domain': 'global', 'reason': 'invalid'},
{'message': "Invalid value for field 'resource.network': 'skyplane'. The URL is malformed.", 'domain': 'global',
'reason': 'invalid'}]">
16:55:48 [WARN]  [AWS] Error removing IPs from security group: An error occurred (MissingParameter) when calling
the RevokeSecurityGroupIngress operation: Either 'ipPermissions' or 'securityGroupRuleIds' should be provided.

Copy link
Contributor

@phi-line phi-line left a comment

Choose a reason for hiding this comment

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

I can't speak to all the details since I'm new to this project, but I gave the code a review and left some notes!

skyplane/replicate/replicator_client.py Outdated Show resolved Hide resolved
skyplane/compute/gcp/gcp_cloud_provider.py Outdated Show resolved Hide resolved
skyplane/replicate/solver.py Outdated Show resolved Hide resolved
skyplane/compute/gcp/gcp_pricing.py Show resolved Hide resolved
skyplane/compute/gcp/gcp_key_manager.py Outdated Show resolved Hide resolved
@parasj parasj changed the base branch from main to google-imports November 4, 2022 03:50
Base automatically changed from google-imports to main November 4, 2022 04:57
@parasj parasj merged commit 2d128e2 into main Nov 4, 2022
@parasj parasj deleted the dev/gcp_network branch November 4, 2022 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants