[jira] [Commented] (AIRFLOW-2829) Brush up the CI script for minikube
[ https://issues.apache.org/jira/browse/AIRFLOW-2829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16623405#comment-16623405 ] Iuliia Volkova commented on AIRFLOW-2829: - [~sekikn], could you close the ticket, as the PR was already merged? or [~ashb] > Brush up the CI script for minikube > --- > > Key: AIRFLOW-2829 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2829 > Project: Apache Airflow > Issue Type: Bug > Components: ci >Reporter: Kengo Seki >Assignee: Kengo Seki >Priority: Major > > Ran {{scripts/ci/kubernetes/minikube/start_minikube.sh}} locally and found > some points that can be improved: > - minikube version is hard-coded > - Defined but unused variables: {{$_HELM_VERSION}}, {{$_VM_DRIVER}} > - Undefined variables: {{$unameOut}} > - The following lines cause warnings if download is skipped: > {code} > 69 sudo mv bin/minikube /usr/local/bin/minikube > 70 sudo mv bin/kubectl /usr/local/bin/kubectl > {code} > - {{return}} s at line 81 and 96 won't work since it's outside of a function > - To run this script as a non-root user, {{-E}} is required for {{sudo}}. See > https://github.com/kubernetes/minikube/issues/1883. > {code} > 105 _MINIKUBE="sudo PATH=$PATH minikube" > 106 > 107 $_MINIKUBE config set bootstrapper localkube > 108 $_MINIKUBE start --kubernetes-version=${_KUBERNETES_VERSION} > --vm-driver=none > 109 $_MINIKUBE update-context > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRFLOW-2829) Brush up the CI script for minikube
[ https://issues.apache.org/jira/browse/AIRFLOW-2829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16566015#comment-16566015 ] ASF GitHub Bot commented on AIRFLOW-2829: - r39132 closed pull request #3676: [AIRFLOW-2829] Brush up the CI script for minikube URL: https://github.com/apache/incubator-airflow/pull/3676 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/scripts/ci/kubernetes/minikube/start_minikube.sh b/scripts/ci/kubernetes/minikube/start_minikube.sh index 5171a26313..c9388e08ff 100755 --- a/scripts/ci/kubernetes/minikube/start_minikube.sh +++ b/scripts/ci/kubernetes/minikube/start_minikube.sh @@ -24,19 +24,19 @@ _MY_SCRIPT="${BASH_SOURCE[0]}" _MY_DIR=$(cd "$(dirname "$_MY_SCRIPT")" && pwd) # Avoids 1.7.x because of https://github.com/kubernetes/minikube/issues/2240 _KUBERNETES_VERSION="${KUBERNETES_VERSION}" +_MINIKUBE_VERSION="${MINIKUBE_VERSION:-v0.26.0}" -echo "setting up kubernetes ${_KUBERNETES_VERSION}" +echo "setting up kubernetes ${_KUBERNETES_VERSION}, using minikube ${_MINIKUBE_VERSION}" -_MINIKUBE_VERSION="v0.26.0" -_HELM_VERSION=v2.8.1 -_VM_DRIVER=none +_VM_DRIVER="${VM_DRIVER:-none}" USE_MINIKUBE_DRIVER_NONE=true _UNAME_OUT=$(uname -s) case "${_UNAME_OUT}" in Linux*) _MY_OS=linux;; Darwin*)_MY_OS=darwin;; -*) _MY_OS="UNKNOWN:${unameOut}" +*) echo "${_UNAME_OUT} is unsupported." +exit 1;; esac echo "Local OS is ${_MY_OS}" @@ -58,27 +58,25 @@ if [[ ! -x /usr/local/bin/kubectl ]]; then curl -Lo bin/kubectl \ https://storage.googleapis.com/kubernetes-release/release/${_KUBERNETES_VERSION}/bin/${_MY_OS}/amd64/kubectl chmod +x bin/kubectl + sudo mv bin/kubectl /usr/local/bin/kubectl fi if [[ ! -x /usr/local/bin/minikube ]]; then echo Downloading minikube. curl -Lo bin/minikube \ https://storage.googleapis.com/minikube/releases/${_MINIKUBE_VERSION}/minikube-${_MY_OS}-amd64 chmod +x bin/minikube + sudo mv bin/minikube /usr/local/bin/minikube fi -sudo mv bin/minikube /usr/local/bin/minikube -sudo mv bin/kubectl /usr/local/bin/kubectl - export PATH="${_MY_DIR}/bin:$PATH" if [[ "${USE_MINIKUBE_DRIVER_NONE:-}" = "true" ]]; then # Run minikube with none driver. # See https://blog.travis-ci.com/2017-10-26-running-kubernetes-on-travis-ci-with-minikube - _VM_DRIVER="--vm-driver=none" + _VM_DRIVER=none if [[ ! -x /usr/local/bin/nsenter ]]; then # From https://engineering.bitnami.com/articles/implementing-kubernetes-integration-tests-in-travis.html # Travis ubuntu trusty env doesn't have nsenter, needed for --vm-driver=none -which nsenter >/dev/null && return 0 echo "INFO: Building 'nsenter' ..." cat <<-EOF | docker run -i --rm -v "$(pwd):/build" ubuntu:14.04 >& nsenter.build.log apt-get update @@ -93,7 +91,7 @@ EOF if [ ! -f ./nsenter ]; then echo "ERROR: nsenter build failed, log:" cat nsenter.build.log -return 1 +exit 1 fi echo "INFO: nsenter build OK" sudo mv ./nsenter /usr/local/bin @@ -102,10 +100,10 @@ fi echo "your path is ${PATH}" -_MINIKUBE="sudo PATH=$PATH minikube" +_MINIKUBE="sudo -E PATH=$PATH minikube" $_MINIKUBE config set bootstrapper localkube -$_MINIKUBE start --kubernetes-version=${_KUBERNETES_VERSION} --vm-driver=none +$_MINIKUBE start --kubernetes-version=${_KUBERNETES_VERSION} --vm-driver=${_VM_DRIVER} $_MINIKUBE update-context # Wait for Kubernetes to be up and ready. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Brush up the CI script for minikube > --- > > Key: AIRFLOW-2829 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2829 > Project: Apache Airflow > Issue Type: Bug > Components: ci >Reporter: Kengo Seki >Assignee: Kengo Seki >Priority: Major > > Ran {{scripts/ci/kubernetes/minikube/start_minikube.sh}} locally and found > some points that can be improved: > - minikube version is hard-coded > - Defined but unused variables: {{$_HELM_VERSION}}, {{$_VM_DRIVER}} > - Undefined variables: {{$unameOut}} > - The following lines cause warnings if download is skipped: > {code} > 69 sudo mv bin/minikube /usr/local/bin/minikube > 70 sudo mv bin/kubectl /usr/local/bin/kubectl > {code} > - {{return}} s at line 81 and 96 won't work since it's
[jira] [Commented] (AIRFLOW-2829) Brush up the CI script for minikube
[ https://issues.apache.org/jira/browse/AIRFLOW-2829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16566016#comment-16566016 ] ASF subversion and git services commented on AIRFLOW-2829: -- Commit 0d193ada44707ec6f50371cb1fc9cbb96d2466db in incubator-airflow's branch refs/heads/master from [~sekikn] [ https://gitbox.apache.org/repos/asf?p=incubator-airflow.git;h=0d193ad ] [AIRFLOW-2829] Brush up the CI script for minikube Fix scripts/ci/kubernetes/minikube/start_minikube.sh as follows: - Make minikube version configurable via environment variable - Remove unused variables for readability - Reorder some lines to remove warnings - Replace ineffective `return` with `exit` - Add -E to `sudo minikube` so that non-root users can use this script locally > Brush up the CI script for minikube > --- > > Key: AIRFLOW-2829 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2829 > Project: Apache Airflow > Issue Type: Bug > Components: ci >Reporter: Kengo Seki >Assignee: Kengo Seki >Priority: Major > > Ran {{scripts/ci/kubernetes/minikube/start_minikube.sh}} locally and found > some points that can be improved: > - minikube version is hard-coded > - Defined but unused variables: {{$_HELM_VERSION}}, {{$_VM_DRIVER}} > - Undefined variables: {{$unameOut}} > - The following lines cause warnings if download is skipped: > {code} > 69 sudo mv bin/minikube /usr/local/bin/minikube > 70 sudo mv bin/kubectl /usr/local/bin/kubectl > {code} > - {{return}} s at line 81 and 96 won't work since it's outside of a function > - To run this script as a non-root user, {{-E}} is required for {{sudo}}. See > https://github.com/kubernetes/minikube/issues/1883. > {code} > 105 _MINIKUBE="sudo PATH=$PATH minikube" > 106 > 107 $_MINIKUBE config set bootstrapper localkube > 108 $_MINIKUBE start --kubernetes-version=${_KUBERNETES_VERSION} > --vm-driver=none > 109 $_MINIKUBE update-context > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRFLOW-2829) Brush up the CI script for minikube
[ https://issues.apache.org/jira/browse/AIRFLOW-2829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565363#comment-16565363 ] ASF GitHub Bot commented on AIRFLOW-2829: - codecov-io commented on issue #3676: [AIRFLOW-2829] Brush up the CI script for minikube URL: https://github.com/apache/incubator-airflow/pull/3676#issuecomment-40958 # [Codecov](https://codecov.io/gh/apache/incubator-airflow/pull/3676?src=pr=h1) Report > Merging [#3676](https://codecov.io/gh/apache/incubator-airflow/pull/3676?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-airflow/commit/c37fc0b6ba19e3fe5656ae37cef9b59cef3c29e8?src=pr=desc) will **not change** coverage. > The diff coverage is `n/a`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-airflow/pull/3676/graphs/tree.svg?token=WdLKlKHOAU=pr=150=650)](https://codecov.io/gh/apache/incubator-airflow/pull/3676?src=pr=tree) ```diff @@ Coverage Diff @@ ## master #3676 +/- ## == Coverage77.5% 77.5% == Files 205 205 Lines 15753 15753 == Hits12210 12210 Misses 35433543 ``` -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-airflow/pull/3676?src=pr=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/incubator-airflow/pull/3676?src=pr=footer). Last update [c37fc0b...bc5fa06](https://codecov.io/gh/apache/incubator-airflow/pull/3676?src=pr=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Brush up the CI script for minikube > --- > > Key: AIRFLOW-2829 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2829 > Project: Apache Airflow > Issue Type: Bug > Components: ci >Reporter: Kengo Seki >Assignee: Kengo Seki >Priority: Major > > Ran {{scripts/ci/kubernetes/minikube/start_minikube.sh}} locally and found > some points that can be improved: > - minikube version is hard-coded > - Defined but unused variables: {{$_HELM_VERSION}}, {{$_VM_DRIVER}} > - Undefined variables: {{$unameOut}} > - The following lines cause warnings if download is skipped: > {code} > 69 sudo mv bin/minikube /usr/local/bin/minikube > 70 sudo mv bin/kubectl /usr/local/bin/kubectl > {code} > - {{return}} s at line 81 and 96 won't work since it's outside of a function > - To run this script as a non-root user, {{-E}} is required for {{sudo}}. See > https://github.com/kubernetes/minikube/issues/1883. > {code} > 105 _MINIKUBE="sudo PATH=$PATH minikube" > 106 > 107 $_MINIKUBE config set bootstrapper localkube > 108 $_MINIKUBE start --kubernetes-version=${_KUBERNETES_VERSION} > --vm-driver=none > 109 $_MINIKUBE update-context > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRFLOW-2829) Brush up the CI script for minikube
[ https://issues.apache.org/jira/browse/AIRFLOW-2829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16565289#comment-16565289 ] ASF GitHub Bot commented on AIRFLOW-2829: - sekikn opened a new pull request #3676: [AIRFLOW-2829] Brush up the CI script for minikube URL: https://github.com/apache/incubator-airflow/pull/3676 Make sure you have checked _all_ steps below. ### Jira - [x] My PR addresses the following [Airflow Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR" - https://issues.apache.org/jira/browse/AIRFLOW-2829 - In case you are fixing a typo in the documentation you can prepend your commit with \[AIRFLOW-XXX\], code changes always need a Jira issue. ### Description - [x] Here are some details about my PR, including screenshots of any UI changes: Fix scripts/ci/kubernetes/minikube/start_minikube.sh as follows: - Make minikube version configurable via environment variable - Remove unused variables for readability - Reorder some lines to remove warnings - Replace ineffective `return` with `exit` - Add -E to `sudo minikube` so that non-root users can use this script locally ### Tests - [x] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason: No additional test since it's a fix on the setup script for CI. Instead, I ran the revised script locally on Ubuntu 16.04 LTS and confirmed that it worked for both root and non-root user, with the following environmental variables: ``` export KUBERNETES_VERSION=v1.10.0 export MINIKUBE_VERSION=v0.28.2 ``` In addition, I confirmed it worked fine on Travis: https://travis-ci.org/sekikn/incubator-airflow/builds/410712117 ### Commits - [x] My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)": 1. Subject is separated from body by a blank line 1. Subject is limited to 50 characters (not including Jira issue reference) 1. Subject does not end with a period 1. Subject uses the imperative mood ("add", not "adding") 1. Body wraps at 72 characters 1. Body explains "what" and "why", not "how" ### Documentation - [x] In case of new functionality, my PR adds documentation that describes how to use it. - When adding new operators/hooks/sensors, the autoclass documentation generation needs to be added. ### Code Quality - [x] Passes `git diff upstream/master -u -- "*.py" | flake8 --diff` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Brush up the CI script for minikube > --- > > Key: AIRFLOW-2829 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2829 > Project: Apache Airflow > Issue Type: Bug > Components: ci >Reporter: Kengo Seki >Assignee: Kengo Seki >Priority: Major > > Ran {{scripts/ci/kubernetes/minikube/start_minikube.sh}} locally and found > some points that can be improved: > - minikube version is hard-coded > - Defined but unused variables: {{$_HELM_VERSION}}, {{$_VM_DRIVER}} > - Undefined variables: {{$unameOut}} > - The following lines cause warnings if download is skipped: > {code} > 69 sudo mv bin/minikube /usr/local/bin/minikube > 70 sudo mv bin/kubectl /usr/local/bin/kubectl > {code} > - {{return}} s at line 81 and 96 won't work since it's outside of a function > - To run this script as a non-root user, {{-E}} is required for {{sudo}}. See > https://github.com/kubernetes/minikube/issues/1883. > {code} > 105 _MINIKUBE="sudo PATH=$PATH minikube" > 106 > 107 $_MINIKUBE config set bootstrapper localkube > 108 $_MINIKUBE start --kubernetes-version=${_KUBERNETES_VERSION} > --vm-driver=none > 109 $_MINIKUBE update-context > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)