You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/03/22 09:11:40 UTC

[GitHub] [ozone] elek commented on a change in pull request #2029: HDDS-4969. Extract check dependency installation from Github Actions workflow

elek commented on a change in pull request #2029:
URL: https://github.com/apache/ozone/pull/2029#discussion_r598530527



##########
File path: hadoop-ozone/dev-support/checks/kubernetes.sh
##########
@@ -13,9 +13,37 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 cd "$DIR/../../.." || exit 1
 
+if [[ "$(uname -s)" = "Darwin" ]]; then
+  echo "k3s is not supported on Mac" >&2
+  exit 1
+fi
+
+export KUBECONFIG=/etc/rancher/k3s/k3s.yaml

Review comment:
       ```suggestion
   : ${KUBECONFIG:=/etc/rancher/k3s/k3s.yaml}
   ```
   
   Just to support minikube and other users....

##########
File path: hadoop-ozone/dev-support/checks/bats.sh
##########
@@ -13,9 +13,18 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 cd "${DIR}/../../.." || exit 1
 
+_install_tool_callback() {
+  curl -LSs https://github.com/bats-core/bats-core/archive/v1.2.1.tar.gz | tar xzf -
+}
+
+source "${DIR}/_lib.sh"
+install_tool
+export PATH="${PATH}:${TOOL_DIR}/bats-core-1.2.1/bin"

Review comment:
       I like this one (my local install always has higher priority) but in this case if I have bats on my own PATH, we don't need to download the new one...
   
   I don't know what is the best approach, but we may need to skip the download/install of the binaries if they are already available...
   
   Maybe we can switch to a tool based directory hierarchy (`.dev-tools/k3s/...`)  instead of check based hierarchy (`.dev-tools/acceptance/...`). It would also help us to reuse tools if they are used from multiple checks. (but with matrix build it may not be required any more...).
   
   Sg. like `_install_tool <binary_name> <callback>` but you may have a better idea for a good abstraction....
   
   
   
   

##########
File path: hadoop-ozone/dev-support/checks/kubernetes.sh
##########
@@ -13,9 +13,37 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 cd "$DIR/../../.." || exit 1
 
+if [[ "$(uname -s)" = "Darwin" ]]; then
+  echo "k3s is not supported on Mac" >&2
+  exit 1
+fi
+
+export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
+
+_install_tool_callback() {
+  # Install k3s
+  curl -sfL https://get.k3s.io | sh -
+
+  sudo chmod a+r $KUBECONFIG
+
+  # Install flekszible
+  wget https://github.com/elek/flekszible/releases/download/v1.8.1/flekszible_1.8.1_Linux_x86_64.tar.gz -O - | tar -zx
+  chmod +x flekszible
+  mkdir -p ${TOOL_DIR}/bin
+  mv -iv flekszible ${TOOL_DIR}/bin/
+
+  # Install robotframework
+  sudo pip install robotframework

Review comment:
       You can use something like this to avoid sudo:
   
   ```
    virtualenv "${TOOL_DIR}"/robotenv
    source "${TOOL_DIR}"/robotenv/bin/activate
    pip install robotframework
   ```
   and you can add `"${TOOL_DIR}"/robotenv/bin` to the path




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org