Skip to content

Instantly share code, notes, and snippets.

View dims's full-sized avatar

Davanum Srinivas dims

View GitHub Profile
#!/usr/bin/env bash
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@dims
dims / nvi.sh
Last active March 29, 2024 17:29
Notes from running kubetest2 ec2 with nvidia
#!/bin/bash
# All the notes you need!!!
# https://github.com/awslabs/amazon-eks-ami/releases/tag/v20240227
# AMI Name: amazon-eks-gpu-node-1.29-v20240227
# https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html
# https://docs.aws.amazon.com/dlami/latest/devguide/gpu.html
# https://hub.docker.com/r/nvidia/cuda/tags
# https://github.com/NVIDIA/k8s-device-plugin/releases
@dims
dims / run-kubekins-e2e-shell.sh
Last active February 12, 2024 20:17
Drop into the shell inside kubekins-e2e container
# DO NOT TRY THIS ON A MAC or WSL2 :) use a ubuntu vm or something!
# Run the same kubekins container used in the CI job
IMAGE=gcr.io/k8s-staging-test-infra/kubekins-e2e:v20240209-82001bc8c5-main
# Create a temp directory for the DIND docker - see the baked in assumption in some of our images here - https://cs.k8s.io/?q=docker-graph&i=nope&files=&excludeFiles=&repos=kubernetes/test-infra
(sudo mkdir -p /tmp/docker-graph && sudo chmod -R 777 /tmp/docker-graph && cd /tmp/docker-graph && rm -rf *)
# Run as a privileged container, mount both the kubernetes directory and the docker-graph directory
docker run -e DOCKER_IN_DOCKER_ENABLED=true \
@dims
dims / README.md
Last active January 22, 2024 16:32
EKS cluster with a single node using specific AMI

To create

eksctl create cluster -f eks-demo-cluster-001.yaml

To delete

eksctl delete cluster eks-demo-cluster-001 --region us-east-1

@dims
dims / README.md
Last active January 16, 2024 02:36
SOCI w/ k8s
  • use initialize-nginx-image.sh to push nginx:latest into an ECR repository and build the soci index (see here for details)
  • install fuse using sudo yum install fuse -y
  • download and extract files from https://github.com/awslabs/soci-snapshotter/releases/ into /usr/local/bin
  • run sudo chown root:root /usr/local/bin/soci-snapshotter-grpc
  • copy soci-config.toml to /etc/soci-snapshotter-grpc/config.toml
  • copy soci-snapshotter.service to /usr/lib/systemd/system/soci-snapshotter.service
  • enable service using sudo systemctl enable --now soci-snapshotter
  • install sudo yum install -y amazon-ecr-credential-helper (or install from latest release in repo)
  • copy config.json to /root/.docker/config.json
  • run sudo chown root:root /root/.docker/config.json
@dims
dims / README.md
Last active January 11, 2024 20:50
Test latest containerd version using kind

💠 ensure you are on latest go version

$ go version
go version go1.21.6 linux/amd64

💠 ensure kind is in ~/go/src/sigs.k8s.io/kind/

git clone https://github.com/kubernetes-sigs/kind.git ~/go/src/sigs.k8s.io/kind
@dims
dims / build-and-run-al2023.sh
Last active December 9, 2023 20:30
build al2023
#!/bin/bash
##############################################################
set -x
aws s3 ls || exit 1
#export S3_BUCKET=provider-aws-test-infra-dims-west-2
export S3_BUCKET=provider-aws-test-infra-dims-east-1
@dims
dims / gist:eace914fc47209a9f9f8a2cafed586c9
Last active November 19, 2023 10:45
Running the AWS sig-node tests and conformance tests in provider-aws-test-infra repo
# Run from $HOME/go/src/sigs.k8s.io/provider-aws-test-infra
FOCUS="should get a host IP" \
USER=ec2-user \
CLEANUP=false \
DELETE_INSTANCES=false \
IMAGE_CONFIG_DIR=config \
IMAGE_CONFIG_FILE=aws-instance-eks.yaml \
TARGET_BUILD_ARCH="linux/amd64" \
USE_DOCKERIZED_BUILD=true \
gh search prs --state open --label "needs-rebase" --label "do-not-merge/work-in-progress" --sort updated --limit 100 --repo "kubernetes/kubernetes" > prs.txt
cat prs.txt | awk '{print $2}' | xargs -L 1 gh pr comment --repo "kubernetes/kubernetes" --body "This work-in-progress PR needs a rebase. please rebase if this PR is still needed for the upcoming release."
gh search prs --state open --label "needs-rebase" --sort updated --limit 300 --repo "kubernetes/kubernetes" > prs.txt
cat prs.txt | awk '{print $2}' | xargs -L 1 -I {} gh pr view https://github.com/kubernetes/kubernetes/pull/{} --json number,mergeable | jq '"\(.number) \(.mergeable)"' -r
$ scorecard --repo=github.com/kubernetes/kubernetes
Starting [Maintained]
Starting [Dangerous-Workflow]
Starting [Token-Permissions]
Starting [CII-Best-Practices]
Starting [Signed-Releases]
Starting [CI-Tests]
Starting [Packaging]
Starting [SAST]
Starting [Dependency-Update-Tool]