This file contains hidden or 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
import os | |
from dotenv import load_dotenv | |
import requests | |
from slack_sdk import WebClient | |
from slack_sdk.errors import SlackApiError | |
from datetime import date | |
from collections import defaultdict | |
import modal | |
load_dotenv() |
This file contains hidden or 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
# specify base image | |
FROM tensorflow/tensorflow:latest-py3 | |
# create directory to organize files in and enter dir | |
WORKDIR /app | |
COPY requirements.txt . | |
RUN pip3 install -r requirements.txt | |
RUN pip3 install --upgrade protobuf | |
COPY . . |
This file contains hidden or 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
name: Download/Process Nifty Data | |
inputs: | |
- {name: experiment_name, type: String, description: 'Experiment name'} | |
- {name: data_filename, type: String, description: 'Name of data in GCP'} | |
outputs: | |
- {name: result, type: string} |
This file contains hidden or 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
import numpy as np | |
import tensorflow as tf | |
import os | |
import argparse | |
from build.gcp_utils import download_from_gcp, write_to_gcp | |
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" | |
def process_data(filename): | |
print("Downloading from gcp...", flush=True) |
This file contains hidden or 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
import kfp | |
def configure_task(task, cache=True): | |
task.container.add_resource_request("memory", "50Gi") | |
task.container.add_resource_limit("memory", "50Gi") | |
task.container.add_resource_request("cpu", "250m") | |
if not cache: | |
task.execution_options.caching_strategy.max_cache_staleness = "P0D" |