Skip to content

Instantly share code, notes, and snippets.

Avatar

Karl Schriek karlschriek

View GitHub Profile
View alibi_example
import argparse
import matplotlib.pyplot as plt
from tensorflow.keras.applications.inception_v3 import preprocess_input, decode_predictions
import numpy as np
import requests
import json
import os
from PIL import Image
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
View kfp_rest_api_testing.py
import json
import requests
files = {'uploadfile': open("compiled_pipeline.tar.gz", 'rb')}
reponse=requests.post(
f"https://www.{domain}/pipeline/apis/v1beta1/pipelines/upload?resource_reference_key.type=NAMESPACE&resource_reference_key.id={namespace}",
files=files,
cookies=cookies
)
reponse.raise_for_status()
View read_data.yaml
name: JSON S3 Reader
description: Reads a JSON from S3
inputs:
- {name: s3_uri, type: String, description: 'Where to read JSON from'}
implementation:
container:
image: 863518836478.dkr.ecr.eu-central-1.amazonaws.com/dev/kubeflow-120/boto3
command: [python3, read_data.py]
args: [
--s3_uri, {inputValue: s3_uri}
View write_data.yaml
name: JSON S3 Writer
description: Takes three values and writes them to S3 as JSON file
inputs:
- {name: s3_uri, type: String, description: 'Where to write JSON to'}
- {name: max_val, type: Integer, description: 'A value to add to JSON'}
- {name: min_val, type: Integer, description: 'A value to add to JSON'}
- {name: sum_val, type: Integer, description: 'A value to add to JSON'}
implementation:
container:
image: 863518836478.dkr.ecr.eu-central-1.amazonaws.com/dev/kubeflow-120/boto3
View gist:c8d9ed0e410f49e29fc8f946df7f8ce3
import logging
import os
import getpass
import requests
import os
import io
import re
import sys
import stat
import requests