Skip to content

Commit f5816e0

Browse files
authored
[RStudio] fixing the test failure for 2.0 ubuntu images. (#1191)
1 parent f28f0c9 commit f5816e0

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

integration_tests/dataproc_test_case.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class DataprocTestCase(parameterized.TestCase):
4747
COMPONENT = None
4848
INIT_ACTIONS = None
4949
INIT_ACTIONS_REPO = None
50+
IMAGE_VERSION_2_2 = ['2.2-debian12', '2.2-ubuntu22', '2.2-rocky9']
5051

5152
@classmethod
5253
def setUpClass(cls):
@@ -114,6 +115,8 @@ def createCluster(self,
114115
args.append("--image={}".format(FLAGS.image))
115116
elif FLAGS.image_version:
116117
args.append("--image-version={}".format(FLAGS.image_version))
118+
if FLAGS.image_version in self.IMAGE_VERSION_2_2:
119+
args.append("--public-ip-address")
117120

118121
if optional_components:
119122
args.append("--optional-components={}".format(

rstudio/rstudio.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ function run_with_retries() {
103103
"${cmd[@]}"
104104
}
105105

106+
function install_package() {
107+
local LIBDEFLATE0_URL="http://archive.ubuntu.com/ubuntu/pool/universe/libd/libdeflate/libdeflate0_1.5-3_amd64.deb"
108+
local LIBDEFLATE_DEV_URL="http://archive.ubuntu.com/ubuntu/pool/universe/libd/libdeflate/libdeflate-dev_1.5-3_amd64.deb"
109+
TMP_DIR=$(mktemp -d)
110+
wget -q -P "${TMP_DIR}" "${LIBDEFLATE0_URL}"
111+
dpkg -i "${TMP_DIR}/$(basename "${LIBDEFLATE0_URL}")"
112+
wget -q -P "${TMP_DIR}" "${LIBDEFLATE_DEV_URL}"
113+
dpkg -i "${TMP_DIR}/$(basename "${LIBDEFLATE_DEV_URL}")"
114+
rm -rf "${TMP_DIR}"
115+
}
116+
106117
if [[ "${ROLE}" == 'Master' ]]; then
107118
if [[ ${OS_ID} == debian ]] && [[ $(echo "${DATAPROC_IMAGE_VERSION} <= 2.1" | bc -l) == 1 ]]; then
108119
remove_old_backports
@@ -129,6 +140,9 @@ if [[ "${ROLE}" == 'Master' ]]; then
129140
fi
130141
apt-get install -y software-properties-common
131142
add-apt-repository "deb http://cran.r-project.org/bin/linux/${OS_ID} ${OS_CODE}-cran40/"
143+
if [[ ${OS_ID} == ubuntu ]] && [[ $(echo "${DATAPROC_IMAGE_VERSION} == 2.0" | bc -l) == 1 ]]; then
144+
install_package
145+
fi
132146
update_apt_get
133147
apt-get install -y r-base r-base-dev gdebi-core
134148

@@ -147,7 +161,7 @@ if [[ "${ROLE}" == 'Master' ]]; then
147161
fi
148162
if [[ -z "${USER_PASSWORD}" ]]; then
149163
service_file=/etc/systemd/system/rstudio-server.service
150-
if [[ "${OS_CODE}" == "bookworm" ]];then
164+
if [[ "${OS_CODE}" == "bookworm" ]] || [[ "${OS_CODE}" == "jammy" ]];then
151165
service_file=/lib/systemd/system/rstudio-server.service
152166
fi
153167
sed -i 's:ExecStart=\(.*\):Environment=USER=rstudio\nExecStart=\1 --auth-none 1:1' "$service_file"

0 commit comments

Comments
 (0)