Skip to content

Commit

Permalink
got predict job to launch on beaker
Browse files Browse the repository at this point in the history
  • Loading branch information
Hgherzog committed Nov 19, 2024
1 parent 9506f08 commit ec16593
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 4 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Required fields
ds_root: gs://rslearn-eai/datasets/forest_loss_driver/prediction/dataset_20241105
ds_root: gs://rslearn-eai/datasets/forest_loss_driver/prediction/dataset_20241106
model_cfg_fname: "data/forest_loss_driver/config_satlaspretrain_flip_oldmodel_unfreeze.yaml" # should be path from the top of the repo IF NOT ABSOLUTE PATH
gcs_tiff_filenames:
- "cropped_070W_10S_060W_00N.tif"
Expand Down
1 change: 1 addition & 0 deletions rslp/forest_loss_driver/predict_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def run_model_predict(self) -> None:
OPTIONAL_ENV_VARS: list[str] = []
self._validate_required_env_vars(REQUIRED_ENV_VARS, OPTIONAL_ENV_VARS)
# TODO: Add some validation that the extract dataset step is done by checking the dataset bucket
# TODO: This may have unneeded levels of wrapping and abstraction
forest_loss_driver_model_predict(
self.pred_config.model_cfg_fname,
self.pred_config.path,
Expand Down
6 changes: 3 additions & 3 deletions rslp/launcher_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from itertools import product
from typing import Any

import beaker
import yaml
from beaker import DataMount, DataSource, EnvVar, ImageSource
from beaker.client import Beaker
from upath import UPath

CODE_BLOB_PATH = "projects/{project_id}/{experiment_id}/code.zip"
Expand Down Expand Up @@ -183,9 +183,9 @@ def download_code(project_id: str, experiment_id: str) -> None:
print("extraction complete", flush=True)


def upload_image(image_name: str, workspace: str) -> None:
def upload_image(image_name: str, workspace: str, beaker_client: Beaker) -> ImageSource:
"""Upload an image to Beaker."""
image = beaker.image.create(image_name, image_name, workspace=workspace)
image = beaker_client.image.create(image_name, image_name, workspace=workspace)
image_source = ImageSource(beaker=image.full_name)
return image_source

Expand Down
Binary file not shown.

0 comments on commit ec16593

Please sign in to comment.