Skip to content

Instantly share code, notes, and snippets.

View ashemag's full-sized avatar

Ashe Magalhaes ashemag

View GitHub Profile
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()
# 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 . .
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}
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)
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"