Skip to content

Commit

Permalink
Fix oozie.sh - Debian 10 backports repo issue. (#1160)
Browse files Browse the repository at this point in the history
* Fix for Debian 10 backports repo issue.

* Fix for debian10 backports repo issue

* Fix for Debian 10 backports repo issue.

Added function same as gpu init action to keep changes consistent across all init actions.

* Fix oozie.sh - Debian buster repo issue
Added dataproc version check condition

* Fix oozie.sh - Debian buster repo issue
Added condition to consider 2.1 dataproc images as well.
  • Loading branch information
kuldeepkk-dev committed Apr 19, 2024
1 parent 1beab5d commit 1bc7969
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions oozie/oozie.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,24 @@ export MYSQL_ROOT_PASSWORD=$(gcloud secrets versions access --secret ${MYSQL_ROO

NUM_LIVE_DATANODES=0

function remove_old_backports {
# This script uses 'apt-get update' and is therefore potentially dependent on
# backports repositories which have been archived. In order to mitigate this
# problem, we will remove any reference to backports repos older than oldstable

# https://github.com/GoogleCloudDataproc/initialization-actions/issues/1157
oldstable=$(curl -s https://deb.debian.org/debian/dists/oldstable/Release | awk '/^Codename/ {print $2}');
stable=$(curl -s https://deb.debian.org/debian/dists/stable/Release | awk '/^Codename/ {print $2}');

matched_files="$(grep -rsil '\-backports' /etc/apt/sources.list*)"
if [[ -n "$matched_files" ]]; then
for filename in "$matched_files"; do
grep -e "$oldstable-backports" -e "$stable-backports" "$filename" || \
sed -i -e 's/^.*-backports.*$//' "$filename"
done
fi
}

function await_hdfs_datanodes() {
# Wait for HDFS to come online
tryno=0
Expand Down Expand Up @@ -679,6 +697,10 @@ EOF


function main() {
#Remove debian backports
if [[ ${OS_NAME} == debian ]] && [[ $(echo "${DATAPROC_IMAGE_VERSION} <= 2.1" | bc -l) == 1 ]]; then
remove_old_backports
fi
# Only run on the master node of the cluster
if [[ "${ROLE}" == 'Master' ]]; then
install_oozie
Expand Down

0 comments on commit 1bc7969

Please sign in to comment.