From 5010ef7552ef90393c368267c964f63226f7002c Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 10:35:40 -0700 Subject: [PATCH 01/12] Try adding `kind create cluster` test without any setup Signed-off-by: Archit Kulkarni --- .buildkite/example.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.buildkite/example.yml b/.buildkite/example.yml index 2bd1582f94..87f7fa731b 100644 --- a/.buildkite/example.yml +++ b/.buildkite/example.yml @@ -5,4 +5,10 @@ - ls -alp /workdir - export PATH=$PATH:/usr/local/go/bin - cd /workdir/ray-operator - - make test \ No newline at end of file + - make test + +- label: KinD in Docker + instance_size: large + image: golang:1.17 + commands: + - kind create cluster \ No newline at end of file From c810cf4c0ab396614f30dd863a3ea06518599865 Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 11:13:50 -0700 Subject: [PATCH 02/12] Install kind Signed-off-by: Archit Kulkarni --- .buildkite/example.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/example.yml b/.buildkite/example.yml index 87f7fa731b..bd5558d4f9 100644 --- a/.buildkite/example.yml +++ b/.buildkite/example.yml @@ -11,4 +11,5 @@ instance_size: large image: golang:1.17 commands: + - curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64 - kind create cluster \ No newline at end of file From 6b89b9ec3b0ccffd606550090c9d54f5cfca58d3 Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 11:22:07 -0700 Subject: [PATCH 03/12] Finish installing `kind` Signed-off-by: Archit Kulkarni --- .buildkite/example.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.buildkite/example.yml b/.buildkite/example.yml index bd5558d4f9..a397a594f9 100644 --- a/.buildkite/example.yml +++ b/.buildkite/example.yml @@ -12,4 +12,6 @@ image: golang:1.17 commands: - curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64 + - chmod +x ./kind + - sudo mv ./kind /usr/local/bin/kind - kind create cluster \ No newline at end of file From f9d2f8f01dbaf5aad3c66377a313ff2785d548df Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 11:30:53 -0700 Subject: [PATCH 04/12] Remove `sudo` Signed-off-by: Archit Kulkarni --- .buildkite/example.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/example.yml b/.buildkite/example.yml index a397a594f9..11f13b0f30 100644 --- a/.buildkite/example.yml +++ b/.buildkite/example.yml @@ -13,5 +13,5 @@ commands: - curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64 - chmod +x ./kind - - sudo mv ./kind /usr/local/bin/kind + - mv ./kind /usr/local/bin/kind - kind create cluster \ No newline at end of file From 7f716e88d1fee4bf150a774885a51d5377c4b321 Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 11:48:42 -0700 Subject: [PATCH 05/12] Add build and install docker Signed-off-by: Archit Kulkarni --- .buildkite/example.yml | 8 ++++++++ ray-operator/build.sh | 9 +++++++++ ray-operator/install-docker.sh | 16 ++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 ray-operator/build.sh create mode 100644 ray-operator/install-docker.sh diff --git a/.buildkite/example.yml b/.buildkite/example.yml index 11f13b0f30..bc615e762f 100644 --- a/.buildkite/example.yml +++ b/.buildkite/example.yml @@ -11,7 +11,15 @@ instance_size: large image: golang:1.17 commands: + - ls -alp /workdir + - export PATH=$PATH:/usr/local/go/bin - curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64 - chmod +x ./kind - mv ./kind /usr/local/bin/kind + - cd /workdir/ray-operator + - echo Second command + - bash install_docker.sh + - docker ps + - bash build.sh custom_image + - docker run -t --rm custom_image cat /tmp/yeah - kind create cluster \ No newline at end of file diff --git a/ray-operator/build.sh b/ray-operator/build.sh new file mode 100644 index 0000000000..f2d83dbb31 --- /dev/null +++ b/ray-operator/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +SHARED_DIR=/shared + +rm -rf $SHARED_DIR/* +cp -rf ./docker $SHARED_DIR +pushd $SHARED_DIR/docker +docker build -t "$1" . +popd \ No newline at end of file diff --git a/ray-operator/install-docker.sh b/ray-operator/install-docker.sh new file mode 100644 index 0000000000..cdc7a63eb0 --- /dev/null +++ b/ray-operator/install-docker.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive +export TZ=America/Los_Angeles + +export locale -a +export LC_ALL=en_US.utf8 +export LANG=en_US.utf8 + +apt-get update -qq && apt-get upgrade -qq +apt-get install -y -qq \ + curl python-is-python3 git build-essential \ + sudo unzip unrar apt-utils dialog tzdata wget rsync \ + language-pack-en tmux + +curl -o- https://get.docker.com | sh \ No newline at end of file From c22521345659398b506a38eabaaac9b9a32e6571 Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 12:31:17 -0700 Subject: [PATCH 06/12] Test path Signed-off-by: Archit Kulkarni --- .buildkite/example.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.buildkite/example.yml b/.buildkite/example.yml index bc615e762f..24d19aaef6 100644 --- a/.buildkite/example.yml +++ b/.buildkite/example.yml @@ -17,6 +17,7 @@ - chmod +x ./kind - mv ./kind /usr/local/bin/kind - cd /workdir/ray-operator + - ls -l - echo Second command - bash install_docker.sh - docker ps From 8c949771d6ebebcb4f4e4acb04b9cd4b31835481 Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 12:36:08 -0700 Subject: [PATCH 07/12] Rename :( Signed-off-by: Archit Kulkarni --- ray-operator/{install-docker.sh => install_docker.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ray-operator/{install-docker.sh => install_docker.sh} (100%) diff --git a/ray-operator/install-docker.sh b/ray-operator/install_docker.sh similarity index 100% rename from ray-operator/install-docker.sh rename to ray-operator/install_docker.sh From ed490612533cee0709bb5f198858721f4a43780c Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 12:47:18 -0700 Subject: [PATCH 08/12] Separate out working example Signed-off-by: Archit Kulkarni --- .buildkite/example.yml | 3 --- .buildkite/two.yml | 10 ++++++++++ ray-operator/docker/Dockerfile | 3 +++ ray-operator/install_docker.sh | 9 +++++---- 4 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 .buildkite/two.yml create mode 100644 ray-operator/docker/Dockerfile diff --git a/.buildkite/example.yml b/.buildkite/example.yml index 24d19aaef6..9702509768 100644 --- a/.buildkite/example.yml +++ b/.buildkite/example.yml @@ -17,10 +17,7 @@ - chmod +x ./kind - mv ./kind /usr/local/bin/kind - cd /workdir/ray-operator - - ls -l - echo Second command - bash install_docker.sh - docker ps - - bash build.sh custom_image - - docker run -t --rm custom_image cat /tmp/yeah - kind create cluster \ No newline at end of file diff --git a/.buildkite/two.yml b/.buildkite/two.yml new file mode 100644 index 0000000000..e34fa65fab --- /dev/null +++ b/.buildkite/two.yml @@ -0,0 +1,10 @@ +- label: Second pipeline + commands: + - cd /workdir/ray-operator + - echo Second command + - bash install_docker.sh + - docker ps + - bash build.sh custom_image + - docker run -t --rm custom_image cat /tmp/yeah + instance_size: small + image: ubuntu:focal \ No newline at end of file diff --git a/ray-operator/docker/Dockerfile b/ray-operator/docker/Dockerfile new file mode 100644 index 0000000000..56c31bb49c --- /dev/null +++ b/ray-operator/docker/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:latest + +RUN echo TEST PASSED > /tmp/yeah \ No newline at end of file diff --git a/ray-operator/install_docker.sh b/ray-operator/install_docker.sh index cdc7a63eb0..f8d2e373e4 100644 --- a/ray-operator/install_docker.sh +++ b/ray-operator/install_docker.sh @@ -3,9 +3,10 @@ export DEBIAN_FRONTEND=noninteractive export TZ=America/Los_Angeles -export locale -a -export LC_ALL=en_US.utf8 -export LANG=en_US.utf8 +locale -a +locale-gen en_US.UTF-8 +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 apt-get update -qq && apt-get upgrade -qq apt-get install -y -qq \ @@ -13,4 +14,4 @@ apt-get install -y -qq \ sudo unzip unrar apt-utils dialog tzdata wget rsync \ language-pack-en tmux -curl -o- https://get.docker.com | sh \ No newline at end of file +curl -o- https://get.docker.com | sh From 92f5217f1f66b6d89099e415e1e1b01b83b1b490 Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 13:05:10 -0700 Subject: [PATCH 09/12] Reorganize file structure Signed-off-by: Archit Kulkarni --- .buildkite/example.yml | 15 --------------- .buildkite/kind-in-docker.yml | 17 +++++++++++++++++ .buildkite/two.yml | 10 ---------- ray-operator/build.sh | 9 --------- ray-operator/docker/Dockerfile | 3 --- .../install-docker.sh | 0 6 files changed, 17 insertions(+), 37 deletions(-) create mode 100644 .buildkite/kind-in-docker.yml delete mode 100644 .buildkite/two.yml delete mode 100644 ray-operator/build.sh delete mode 100644 ray-operator/docker/Dockerfile rename ray-operator/install_docker.sh => scripts/install-docker.sh (100%) diff --git a/.buildkite/example.yml b/.buildkite/example.yml index 9702509768..40b29a6923 100644 --- a/.buildkite/example.yml +++ b/.buildkite/example.yml @@ -6,18 +6,3 @@ - export PATH=$PATH:/usr/local/go/bin - cd /workdir/ray-operator - make test - -- label: KinD in Docker - instance_size: large - image: golang:1.17 - commands: - - ls -alp /workdir - - export PATH=$PATH:/usr/local/go/bin - - curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64 - - chmod +x ./kind - - mv ./kind /usr/local/bin/kind - - cd /workdir/ray-operator - - echo Second command - - bash install_docker.sh - - docker ps - - kind create cluster \ No newline at end of file diff --git a/.buildkite/kind-in-docker.yml b/.buildkite/kind-in-docker.yml new file mode 100644 index 0000000000..17ba5f3c4b --- /dev/null +++ b/.buildkite/kind-in-docker.yml @@ -0,0 +1,17 @@ +- label: kind in Docker + instance_size: large + image: golang:1.17 + commands: + # Install Go + - export PATH=$PATH:/usr/local/go/bin + + # Install kind + - curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64 + - chmod +x ./kind + - mv ./kind /usr/local/bin/kind + + # Install Docker + - bash scripts/install-docker.sh + + # Create a cluster + - kind create cluster diff --git a/.buildkite/two.yml b/.buildkite/two.yml deleted file mode 100644 index e34fa65fab..0000000000 --- a/.buildkite/two.yml +++ /dev/null @@ -1,10 +0,0 @@ -- label: Second pipeline - commands: - - cd /workdir/ray-operator - - echo Second command - - bash install_docker.sh - - docker ps - - bash build.sh custom_image - - docker run -t --rm custom_image cat /tmp/yeah - instance_size: small - image: ubuntu:focal \ No newline at end of file diff --git a/ray-operator/build.sh b/ray-operator/build.sh deleted file mode 100644 index f2d83dbb31..0000000000 --- a/ray-operator/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -SHARED_DIR=/shared - -rm -rf $SHARED_DIR/* -cp -rf ./docker $SHARED_DIR -pushd $SHARED_DIR/docker -docker build -t "$1" . -popd \ No newline at end of file diff --git a/ray-operator/docker/Dockerfile b/ray-operator/docker/Dockerfile deleted file mode 100644 index 56c31bb49c..0000000000 --- a/ray-operator/docker/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM alpine:latest - -RUN echo TEST PASSED > /tmp/yeah \ No newline at end of file diff --git a/ray-operator/install_docker.sh b/scripts/install-docker.sh similarity index 100% rename from ray-operator/install_docker.sh rename to scripts/install-docker.sh From f3f546059691f56a51d6e3e31556e9576ec56426 Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 14:08:24 -0700 Subject: [PATCH 10/12] Add comment Signed-off-by: Archit Kulkarni --- scripts/install-docker.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/install-docker.sh b/scripts/install-docker.sh index f8d2e373e4..e50a940875 100644 --- a/scripts/install-docker.sh +++ b/scripts/install-docker.sh @@ -1,17 +1,18 @@ #!/bin/bash +# Suppress interactive prompts export DEBIAN_FRONTEND=noninteractive export TZ=America/Los_Angeles -locale -a -locale-gen en_US.UTF-8 -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - apt-get update -qq && apt-get upgrade -qq apt-get install -y -qq \ curl python-is-python3 git build-essential \ sudo unzip unrar apt-utils dialog tzdata wget rsync \ - language-pack-en tmux + language-pack-en tmux locales + +locale -a +locale-gen en_US.UTF-8 +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 curl -o- https://get.docker.com | sh From fd0b35e62d77e07ccafa12189bab94ae87b13313 Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 14:55:35 -0700 Subject: [PATCH 11/12] Remove unnecessary deps Signed-off-by: Archit Kulkarni --- scripts/install-docker.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/install-docker.sh b/scripts/install-docker.sh index e50a940875..10f5849baa 100644 --- a/scripts/install-docker.sh +++ b/scripts/install-docker.sh @@ -5,14 +5,6 @@ export DEBIAN_FRONTEND=noninteractive export TZ=America/Los_Angeles apt-get update -qq && apt-get upgrade -qq -apt-get install -y -qq \ - curl python-is-python3 git build-essential \ - sudo unzip unrar apt-utils dialog tzdata wget rsync \ - language-pack-en tmux locales - -locale -a -locale-gen en_US.UTF-8 -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 +apt-get install -y -qq curl curl -o- https://get.docker.com | sh From 7222f7e48315ed240b0e8b034c13509c6e5e6a6a Mon Sep 17 00:00:00 2001 From: Archit Kulkarni Date: Mon, 17 Jul 2023 15:12:26 -0700 Subject: [PATCH 12/12] Call `kind delete cluster` first Signed-off-by: Archit Kulkarni --- .buildkite/kind-in-docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.buildkite/kind-in-docker.yml b/.buildkite/kind-in-docker.yml index 17ba5f3c4b..2ce907375e 100644 --- a/.buildkite/kind-in-docker.yml +++ b/.buildkite/kind-in-docker.yml @@ -13,5 +13,6 @@ # Install Docker - bash scripts/install-docker.sh - # Create a cluster + # Delete cluster if it already exists + - kind delete cluster - kind create cluster