Skip to content

Instantly share code, notes, and snippets.

View terrytangyuan's full-sized avatar

Yuan Tang terrytangyuan

View GitHub Profile
# This example demonstrates the ability to memoize a template.
# Cache can be configured in configmap. For example, if the cache
# ConfigMap looks like the following, then you should expect the node output
# retrieved from the cache to be "different world".
# Note that you also need to update `creationTimestamp` in
# `data.hello` to be within the `memoize.maxAge` if `maxAge` is specified in the workflow spec.
#
#---
apiVersion: v1
data:
# Hello World
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: hello-world-
spec:
entrypoint: whalesay
templates:
- name: whalesay
container:
Sys.setenv("GITHUB_TOKEN"="")
author <- "terrytangyuan"
from <- "2020-03-30"
until <- "2020-09-10"
orgs <- c("couler-proj", "argoproj", "kubeflow")
pr_info <- list()
for (org in orgs) {
pr_info[[org]] <- list(
@terrytangyuan
terrytangyuan / ant-icla.md
Last active August 27, 2020 00:43
ant-icla.md

Ant Group Individual Contributor License Agreement

Thank you for your interest in contributing documentation and related software code to a project hosted or managed by Ant Group, or any of its affiliates. In order to clarify the intellectual property license granted with Contributions from any person or entity, Ant Group must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This version of the Contributor License Agreement allows an individual to submit Contributions to the applicable project. If you are making a submission on behalf of a legal entity, then you should sign the separation Corporate Contributor License Agreement.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Ant Group. Except for the license granted herein to Ant Group and recipients of documentation and software distributed by Ant Group, You reserve all right, title, and interes

# --------------------------------------------------------------------------------
# airflow
def create_dag(dag_id,
schedule,
dag_number,
default_args):
def hello_world_py(*args):
print('Hello World')
@terrytangyuan
terrytangyuan / mpijob-v1alpha2-example-with-volume.yaml
Created March 9, 2020 17:48
MPIJob v1alpha2 example spec with volume
apiVersion: kubeflow.org/v1alpha2
kind: MPIJob
metadata:
name: tensorflow-benchmarks-imagenet
spec:
slotsPerWorker: 8
cleanPodPolicy: Running
mpiReplicaSpecs:
Launcher:
replicas: 1
@terrytangyuan
terrytangyuan / mpijob-v1alpha2-example.yaml
Created March 9, 2020 17:46
MPIJob v1alpha2 example spec
apiVersion: kubeflow.org/v1alpha2
kind: MPIJob
metadata:
name: tensorflow-benchmarks
spec:
slotsPerWorker: 1
cleanPodPolicy: Running
mpiReplicaSpecs:
Launcher:
replicas: 1
"""An example of training Keras model with multi-worker strategies."""
import tensorflow as tf
dataset = tf.data.Dataset.from_tensor_slices((x, y))
model = tf.keras.Sequential()
model.add(tf.keras.layers.Dense(16, activation='relu', input_shape=(10,)))
model.add(tf.keras.layers.Dense(1, activation='sigmoid'))
# Keras
from keras.layers import Dense, Activation
model.add(Dense(output_dim=64, input_dim=100))
mode.add(Activation('relu'))
model.add(Dense(output_dim=10))
model.add(Activation('softmax'))
model.compile(loss='categorical_crossentropy', optimizer='sgd', metrics=['accuracy'])