Skip to content

Instantly share code, notes, and snippets.

🦁
in the jungle

Kun 1ambda

Block or report user

Report or block 1ambda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@1ambda
1ambda / yarn-find-apps.sh
Last active Mar 2, 2019
yarn-find-apps.sh
View yarn-find-apps.sh
#!/usr/bin/env bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function usage() {
echo "Usage:
${0##*/} [-h][-n=APP][-r=SECONDS][-b=DATETIME][-s=STATES][-o=ORDER]
Options:
View jupyterhub.helm-config-profileList.yaml
singleuser:
...
memory:
limit: 2G
guarantee: 1G
cpu:
limit: 1
guarantee: .25
View jupyterhub.helm-config-nodeLabel.yaml
proxy:
nodeSelector:
eks-compute-type: none
hub:
nodeSelector:
eks-compute-type: none
singleuser:
nodeSelector:
View eks-node-labels.tf
worker_group_launch_template_count = 2
worker_groups_launch_template = [
{
# Jupyter Pod 을 위한 Spot 인스턴스 그룹
name = "ig-01"
instance_type = "c5.xlarge"
override_instance_type = "c5.2xlarge"
kubelet_extra_args = "--node-labels=eks-instance-group=ig-01,eks-compute-type=cpu"
},
View jupyterhub.helm-install.sh
helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
helm repo update
RELEASE=jupyterhub
NAMESPACE=jupyterhub
# https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/master/jupyterhub/values.yaml
helm upgrade --install $RELEASE jupyterhub/jupyterhub \
--namespace $NAMESPACE \
--version=0.8.0-beta.1 \
View calculate-bid-price.tf
locals {
spot_default_factor = 0.8
spot_on_demand_price_r5xlarge = 0.304
spot_bid_price_r5xlarge = "${format("%.2f", __builtin_StringToFloat(local.spot_on_demand_price_r5xlarge) * __builtin_StringToFloat(local.spot_default_factor))}"
}
View update-emr-instance-tag.sh
#!/bin/bash
export IS_MASTER=$(cat /mnt/var/lib/info/instance.json | jq -r ".isMaster")
export INSTANCE_GROUP_ID=$(cat /mnt/var/lib/info/instance.json | jq -r ".instanceGroupId")
export CLUSTER_ID=$(cat /mnt/var/lib/info/job-flow.json | jq -r ".jobFlowId")
export INSTANCE_ID=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)
export INSTANCE_GROUP_TYPE=$(cat /mnt/var/lib/info/job-flow.json | jq -r ".instanceGroups | .[] | select( .instanceGroupId == \"${INSTANCE_GROUP_ID}\") | .instanceRole" | tr a-z A-Z)
export CURRENT_TAG_NAME=$(aws ec2 --region ap-northeast-2 describe-tags --filters Name=resource-id,Values=${INSTANCE_ID} | jq -r ".Tags | .[] | select( .Key == \"Name\") | .Value")
export NEW_TAG_NAME="${CURRENT_TAG_NAME}-${INSTANCE_GROUP_TYPE}"
View emr_bootstrap_action.tf
bootstrap_action = [
...
{
path = "s3://${aws_s3_bucket_object.emr_bootstrap_assign_private_ip.bucket}/${aws_s3_bucket_object.emr_bootstrap_assign_private_ip.id}"
name = "${aws_s3_bucket_object.emr_bootstrap_assign_private_ip.key}"
args = [
"${lookup(local.spark_batch_cluster_01, "fixed_ip")}"
]
},
]
View assign-private-ip.py
#!/usr/bin/python
#
#Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
#Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
#except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
#or in the "license" file accompanying this file. This file is distributed on an "AS IS"
View template.kops-manifest.yaml
masterPublicName: api.kops.${project}.${enterprise}.enterprise.${vendor}.k8s.local
networkCIDR: ${vpc_cidr}
networkID: ${vpc_id}
networking:
weave:
mtu: 8912
nonMasqueradeCIDR: 100.64.0.0/10
sshAccess:
- 0.0.0.0/0
subnets:
You can’t perform that action at this time.