From de53255ab1120d372f641b8bb4dda4a2e647dc0c Mon Sep 17 00:00:00 2001 From: Nemo Date: Tue, 13 Dec 2022 12:48:36 +0530 Subject: [PATCH] [gke] Drop older automation --- Gemfile | 2 -- Gemfile.lock | 58 --------------------------------------------------- HACKING.md | 5 ----- Rakefile | 7 ------- _auto/gke.rb | 58 --------------------------------------------------- _data/gke.yml | 18 ---------------- netlify.toml | 2 -- 7 files changed, 150 deletions(-) delete mode 100644 Rakefile delete mode 100644 _auto/gke.rb delete mode 100644 _data/gke.yml diff --git a/Gemfile b/Gemfile index 232ccdc8d1b..dd9f14bb6cf 100644 --- a/Gemfile +++ b/Gemfile @@ -23,5 +23,3 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem "wdm", "~> 0.1.0" if Gem.win_platform? gem "webrick", "~> 1.7" - -gem 'google-cloud-container', '~> 1.3' diff --git a/Gemfile.lock b/Gemfile.lock index 1575eefab0c..2c4c5c4ffcd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,56 +14,9 @@ GEM eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) - faraday (2.7.1) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - faraday-retry (2.0.0) - faraday (~> 2.0) ffi (1.15.5) forwardable-extended (2.6.0) - gapic-common (0.15.1) - faraday (>= 1.9, < 3.a) - faraday-retry (>= 1.0, < 3.a) - google-protobuf (~> 3.14) - googleapis-common-protos (>= 1.3.12, < 2.a) - googleapis-common-protos-types (>= 1.3.1, < 2.a) - googleauth (~> 1.0) - grpc (~> 1.36) gemoji (4.0.1) - google-cloud-container (1.3.0) - google-cloud-container-v1 (>= 0.0, < 2.a) - google-cloud-container-v1beta1 (>= 0.0, < 2.a) - google-cloud-core (~> 1.6) - google-cloud-container-v1 (0.12.0) - gapic-common (>= 0.12, < 2.a) - google-cloud-errors (~> 1.0) - google-cloud-container-v1beta1 (0.13.0) - gapic-common (>= 0.12, < 2.a) - google-cloud-errors (~> 1.0) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.0) - google-protobuf (3.21.11-x86_64-linux) - googleapis-common-protos (1.3.12) - google-protobuf (~> 3.14) - googleapis-common-protos-types (~> 1.2) - grpc (~> 1.27) - googleapis-common-protos-types (1.4.0) - google-protobuf (~> 3.14) - googleauth (1.3.0) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) - grpc (1.50.0-x86_64-linux) - google-protobuf (~> 3.21) - googleapis-common-protos-types (~> 1.0) html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) @@ -107,7 +60,6 @@ GEM jekyll (>= 3.8.5) jekyll-seo-tag (~> 2.0) rake (>= 12.3.1, < 13.1.0) - jwt (2.5.0) kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) @@ -116,14 +68,11 @@ GEM listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - memoist (0.16.2) mercenary (0.4.0) mini_i18n (0.8.0) minitest (5.16.3) - multi_json (1.15.0) nokogiri (1.13.10-x86_64-linux) racc (~> 1.4) - os (1.1.4) pathutil (0.16.2) forwardable-extended (~> 2.6) posix-spawn (0.3.15) @@ -135,15 +84,9 @@ GEM ffi (~> 1.0) rexml (3.2.5) rouge (4.0.0) - ruby2_keywords (0.0.5) safe_yaml (1.0.5) sassc (2.4.0) ffi (~> 1.9) - signet (0.17.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) tzinfo (2.0.5) @@ -155,7 +98,6 @@ PLATFORMS x86_64-linux DEPENDENCIES - google-cloud-container (~> 1.3) jekyll (~> 4.3.1) jekyll-feed (~> 0.17) jekyll-last-modified-at diff --git a/HACKING.md b/HACKING.md index 1bc576cf45f..7d3b9f8da76 100644 --- a/HACKING.md +++ b/HACKING.md @@ -6,7 +6,6 @@ - [Build](#build) - [File and Directory structure](#file-and-directory-structure) - [Automation](#automation) - - [GKE](#gke) - [API](#api) - [API Documentation](#api-documentation) - [Contributing Workflow](#contributing-workflow) @@ -74,10 +73,6 @@ Automation is currently focused towards fetching the latest releases for a given All scripts should have fallback data in some form. -### GKE - -The GKE data is fetched at build-time via GKE APIs by calling `rake gke`. - ## API The API is just JSON files generated in the `api` directory by `_plugins/create-json-files.rb`. The API is not stable, because the key names or release names are not consistent. diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 274d7d48bff..00000000000 --- a/Rakefile +++ /dev/null @@ -1,7 +0,0 @@ -require 'yaml' -require_relative '_auto/gke' - -desc "Generate gke.yml" -task :gke do - generate_gke -end diff --git a/_auto/gke.rb b/_auto/gke.rb deleted file mode 100644 index 83cc7809e0a..00000000000 --- a/_auto/gke.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'base64' -require 'google-cloud-container' - -# Takes the service account creds from -# the GOOGLE_CLOUD_SERVICE_ACCOUNT environment variable -# and stores them at the given path -def generate_creds(output_file) - creds = Base64.decode64 ENV['GOOGLE_CLOUD_SERVICE_ACCOUNT'] - File.write output_file, creds - ENV['CONTAINER_CREDENTIALS'] = output_file -end - -def get_cluster_config - client = Google::Cloud::Container.cluster_manager - data = client.get_server_config({ - name: 'projects/endoflife-date/locations/us-west1' - }).to_h -end - -# The service account has zero permissions -# So it is not really sensitive -def generate_gke - json_path = '/tmp/service-account.json' - generate_creds json_path - - result = {} - data = get_cluster_config - - # List of currently supported minor versions - minor_versions = data[:valid_master_versions] - .map { |v| v[0..3] } - .uniq - - channels = %w[RAPID REGULAR STABLE] - - result = { - 'default_cluster_version' => data[:default_cluster_version], - # Go through all channels and pick default_version from the first entry - 'channels' => channels.to_h do |c| - [c, data[:channels].select do |x| - x[:channel] == c.to_sym - end.first[:default_version]] - end, - 'versions' => minor_versions.to_h do |mv| - [mv, data[:valid_master_versions] - # Find the highest patch release for every minor version - .filter { |v| v[0..3] == mv } - # Sort them, and pick the last (max) - .max_by(&Gem::Version.method(:new))] - end - } - - # A sample YAML equivalent of this file is committed to _data/gke.yml - File.write '_data/gke.json', result.to_json -end diff --git a/_data/gke.yml b/_data/gke.yml deleted file mode 100644 index cd717584e7f..00000000000 --- a/_data/gke.yml +++ /dev/null @@ -1,18 +0,0 @@ -# The below is a placeholder version of the output of -# bundle exec rake gke -# For deploys and deploy previews, a _data/gke.json file is generated -# By running rake gke (which runs _auto/gke.rb) -# See https://jekyllrb.com/docs/datafiles/ for how this is used in Jekyll -# This data is ingested by gke.md -channels: - RAPID: rapidDefaultPlaceholder - REGULAR: regularDefaultPlaceholder - STABLE: stableDefaultPlaceholder -default_cluster_version: defaultClusterVersionPlaceholder -versions: - "1.21": "1.21.x" - "1.22": "1.22.x" - "1.20": "1.20.x" - "1.19": "1.19.x" - "1.18": "1.18.x" - "1.17": "1.17.x" diff --git a/netlify.toml b/netlify.toml index f435d477d2b..b0ab893ef09 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,13 +1,11 @@ [build] command = """ - rake gke bundle exec jekyll build """ publish = "_site/" [context.deploy-preview] command = """ - rake gke printf "url: %s" "$DEPLOY_PRIME_URL" > _config_netlify.yml bundle exec jekyll build --config _config.yml,_config_netlify.yml """