-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a802031
commit a35522a
Showing
2 changed files
with
24 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from block_cascade import GcpEnvironmentConfig, GcpMachineConfig, GcpResource | ||
from block_cascade import remote | ||
|
||
GCP_PROJECT = "test-project" | ||
GCP_STORAGE_LOCATION = f"gs://{GCP_PROJECT}-cascade/" | ||
|
||
|
||
def test_remote_local_override(): | ||
"""Test the remote decorator with the local executor using the no_resource_on_local flag.""" | ||
machine_config = GcpMachineConfig(type="n1-standard-4") | ||
gcp_resource = GcpResource( | ||
chief=machine_config, | ||
environment=GcpEnvironmentConfig( | ||
storage_location=GCP_STORAGE_LOCATION, project=GCP_PROJECT | ||
), | ||
) | ||
|
||
@remote(resource=gcp_resource, no_resource_on_local=True) | ||
def multiply(a: int, b: int) -> int: | ||
return a * b | ||
|
||
result = multiply(1, 2) | ||
|
||
assert result == 2 |