Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .buildkite/setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ python3 -m venv .venv
# Activate the virtual environment and then execute the subsequent commands
# within the same sub-shell.
(
# shellcheck disable=SC1091 # Ignore: activate script is created by venv
source .venv/bin/activate

# Install requirements
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ repos:
hooks:
- id: gitleaks

- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.10.0
hooks:
- id: shellcheck

- repo: local
hooks:
- id: golangci-lint
Expand Down
11 changes: 6 additions & 5 deletions apiserver/hack/update-swagger-ui.bash
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/bin/bash
set -e
set -x
readonly REPO_ROOT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"/../.. &> /dev/null && pwd)
REPO_ROOT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"/../.. &> /dev/null && pwd)
readonly REPO_ROOT_DIR
readonly TARGET_DIR="${REPO_ROOT_DIR}/third_party/swagger-ui"
readonly SWAGGER_UI_VERSION=${1:-"5.4.1"}
readonly SWAGGER_UI_TAR_URL="https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${SWAGGER_UI_VERSION}.tar.gz"

if [ -f ${TARGET_DIR}/swagger-initializer.js ];then
cp -v ${TARGET_DIR}/swagger-initializer.js ${TARGET_DIR}/swagger-initializer.js.backup
if [ -f "${TARGET_DIR}"/swagger-initializer.js ];then
cp -v "${TARGET_DIR}"/swagger-initializer.js "${TARGET_DIR}"/swagger-initializer.js.backup
fi
echo "Downloading '${SWAGGER_UI_TAR_URL}' to update ${TARGET_DIR}"
tmp="$(mktemp -d)"
#pushd .
curl --output-dir ${tmp} --fail --silent --location --remote-header-name --remote-name ${SWAGGER_UI_TAR_URL}
tar -xzvf ${tmp}/swagger-ui-${SWAGGER_UI_VERSION}.tar.gz -C ${tmp}
curl --output-dir "${tmp}" --fail --silent --location --remote-header-name --remote-name "${SWAGGER_UI_TAR_URL}"
tar -xzvf "${tmp}"/swagger-ui-"${SWAGGER_UI_VERSION}".tar.gz -C "${tmp}"
#popd
cp -rv "$tmp/swagger-ui-${SWAGGER_UI_VERSION}/dist/"* "${TARGET_DIR}"
rm -rf "$tmp"
13 changes: 7 additions & 6 deletions helm-chart/script/chart-test.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/usr/bin/env bash
if [ -L ${BASH_SOURCE-$0} ]; then
PWD=$(dirname $(readlink "${BASH_SOURCE-$0}"))
if [ -L "${BASH_SOURCE-$0}" ]; then
PWD=$(dirname "$(readlink "${BASH_SOURCE-$0}")")
else
PWD=$(dirname ${BASH_SOURCE-$0})
PWD=$(dirname "${BASH_SOURCE-$0}")
fi
export CURRENT_PATH=$(cd "${PWD}">/dev/null; pwd)
CURRENT_PATH=$(cd "${PWD}">/dev/null || exit 1; pwd)
export CURRENT_PATH
export KUBERAY_HOME=${CURRENT_PATH}/../../

cd $KUBERAY_HOME
cd "$KUBERAY_HOME" || exit 1
if [ "$#" == 1 ] && [ "$1" == "local" ]; then
ct lint --all --chart-dirs helm-chart/ --validate-maintainers=false
else
docker run -it --network host --workdir=/data --volume ~/.kube/config:/root/.kube/config:ro \
--volume $(pwd):/data quay.io/helmpack/chart-testing:v3.5.0 \
--volume "$(pwd)":/data quay.io/helmpack/chart-testing:v3.5.0 \
ct lint --all --chart-dirs helm-chart/ --validate-maintainers=false
fi
10 changes: 5 additions & 5 deletions install/prometheus/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"

# Install the kube-prometheus-stack v48.2.1 helm chart with `overrides.yaml` file.
# https://github.com/prometheus-community/helm-charts/tree/kube-prometheus-stack-48.2.1/charts/kube-prometheus-stack
helm --namespace prometheus-system install prometheus prometheus-community/kube-prometheus-stack --create-namespace --version 48.2.1 -f ${DIR}/overrides.yaml
helm --namespace prometheus-system install prometheus prometheus-community/kube-prometheus-stack --create-namespace --version 48.2.1 -f "${DIR}"/overrides.yaml

# set the place of monitor files
monitor_dir=${DIR}/../../config/prometheus
monitor_dir="${DIR}"/../../config/prometheus

# start to install monitor
pushd ${monitor_dir}
for file in `ls`
pushd "${monitor_dir}"
for file in *
do
kubectl apply -f ${file}
kubectl apply -f "${file}"
done
popd
4 changes: 2 additions & 2 deletions ray-operator/hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
set -o errexit
set -o nounset
set -o pipefail

export GOPATH=$(go env GOPATH)
GOPATH=$(go env GOPATH)
export GOPATH

SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
ROOT_PKG=github.com/ray-project/kuberay/ray-operator
Expand Down
15 changes: 8 additions & 7 deletions scripts/helm-render-yaml.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/usr/bin/env bash
if [ -L ${BASH_SOURCE-$0} ]; then
PWD=$(dirname $(readlink "${BASH_SOURCE-$0}"))
if [ -L "${BASH_SOURCE-$0}" ]; then
PWD=$(dirname "$(readlink "${BASH_SOURCE-$0}")")
else
PWD=$(dirname ${BASH_SOURCE-$0})
PWD=$(dirname "${BASH_SOURCE-$0}")
fi
export CURRENT_PATH=$(cd "${PWD}">/dev/null; pwd)
CURRENT_PATH=$(cd "${PWD}">/dev/null || exit 1; pwd)
export CURRENT_PATH
export KUBERAY_HOME=${CURRENT_PATH}/..

cd $KUBERAY_HOME/helm-chart/kuberay-operator/
cd "$KUBERAY_HOME"/helm-chart/kuberay-operator/ || exit 1
declare -a YAML_ARRAY=("role.yaml" "ray_rayjob_editor_role.yaml" "ray_rayjob_viewer_role.yaml" "leader_election_role.yaml" "ray_rayservice_editor_role.yaml" "ray_rayservice_viewer_role.yaml" )
mkdir -p $KUBERAY_HOME/scripts/tmp
mkdir -p "$KUBERAY_HOME"/scripts/tmp
for name in "${YAML_ARRAY[@]}"; do
helm template -s templates/$name . > $CURRENT_PATH/tmp/$name
helm template -s templates/"$name" . > "$CURRENT_PATH"/tmp/"$name"
done
2 changes: 1 addition & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euo pipefail
dirs_to_lint="ray-operator kubectl-plugin"

for dir in $dirs_to_lint; do
pushd $dir
pushd "$dir"
golangci-lint run --fix --exclude-files _generated.go --timeout 10m0s
popd
done
Loading