Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions hadoop-ozone/dist/src/main/compose/upgrade/compose/non-ha/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

HDDS_VERSION=${hdds.version}
OZONE_RUNNER_VERSION=${docker.ozone-runner.version}
OZONE_RUNNER_IMAGE=apache/ozone-runner
OZONE_TEST_IMAGE=apache/ozone-runner:${docker.ozone-runner.version}
OZONE_DIR=/opt/hadoop
OZONE_VOLUME=./data
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

# reusable fragments (see https://docs.docker.com/compose/compose-file/#extension-fields)
x-common-config:
&common-config
env_file:
- docker-config
image: ${OZONE_TEST_IMAGE}

x-environment:
&environment
OZONE-SITE.XML_ozone.server.default.replication: ${OZONE_REPLICATION_FACTOR:-1}
OZONE_UPGRADE_TO: ${OZONE_UPGRADE_TO:-0}
OZONE_UPGRADE_FROM: ${OZONE_UPGRADE_FROM:-0}

x-datanode:
&datanode
command: ["ozone","datanode"]
<<: *common-config
environment:
<<: *environment
ports:
- 19864
- 9882

x-volumes:
- &ozone-dir ${TEST_DIR}/../..:${OZONE_DIR}
- &transformation ${TEST_DIR}/../../libexec/transformation.py:/opt/hadoop/libexec/transformation.py

services:
om:
command: ["ozone","om"]
<<: *common-config
environment:
ENSURE_OM_INITIALIZED: /data/metadata/om/current/VERSION
<<: *environment
ports:
- 9862
- 9874
networks:
net:
ipv4_address: 10.9.0.11
volumes:
- ${OZONE_VOLUME}/om:/data
- *ozone-dir
- *transformation
scm:
command: ["ozone","scm"]
<<: *common-config
environment:
ENSURE_SCM_INITIALIZED: /data/metadata/scm/current/VERSION
OZONE-SITE.XML_hdds.scm.safemode.min.datanode: ${OZONE_SAFEMODE_MIN_DATANODES:-1}
<<: *environment
networks:
net:
ipv4_address: 10.9.0.12
ports:
- 9876:9876
volumes:
- ${OZONE_VOLUME}/scm:/data
- *ozone-dir
- *transformation
dn1:
<<: *datanode
networks:
net:
ipv4_address: 10.9.0.13
volumes:
- ${OZONE_VOLUME}/dn1:/data
- *ozone-dir
- *transformation
dn2:
<<: *datanode
networks:
net:
ipv4_address: 10.9.0.14
volumes:
- ${OZONE_VOLUME}/dn2:/data
- *ozone-dir
- *transformation
dn3:
<<: *datanode
networks:
net:
ipv4_address: 10.9.0.15
volumes:
- ${OZONE_VOLUME}/dn3:/data
- *ozone-dir
- *transformation
dn4:
<<: *datanode
networks:
net:
ipv4_address: 10.9.0.16
volumes:
- ${OZONE_VOLUME}/dn4:/data
- *ozone-dir
- *transformation
dn5:
<<: *datanode
networks:
net:
ipv4_address: 10.9.0.17
volumes:
- ${OZONE_VOLUME}/dn5:/data
- *ozone-dir
- *transformation
recon:
command: ["ozone","recon"]
<<: *common-config
environment:
<<: *environment
networks:
net:
ipv4_address: 10.9.0.18
ports:
- 9888:9888
volumes:
- ${OZONE_VOLUME}/recon:/data
- *ozone-dir
- *transformation
s3g:
command: ["ozone","s3g"]
<<: *common-config
environment:
<<: *environment
networks:
net:
ipv4_address: 10.9.0.19
ports:
- 9878:9878
volumes:
- ${OZONE_VOLUME}/s3g:/data
- *ozone-dir
- *transformation
networks:
net:
driver: bridge
ipam:
config:
- subnet: 10.9.0.0/16
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

OZONE-SITE.XML_ozone.metadata.dirs=/data/metadata

OZONE-SITE.XML_ozone.client.failover.max.attempts=6

OZONE-SITE.XML_ozone.om.address=om
OZONE-SITE.XML_ozone.om.http-address=om:9874

OZONE-SITE.XML_ozone.scm.container.size=1GB
OZONE-SITE.XML_ozone.scm.datanode.ratis.volume.free-space.min=10MB
OZONE-SITE.XML_ozone.scm.pipeline.creation.interval=30s
OZONE-SITE.XML_ozone.scm.pipeline.owner.container.count=1
OZONE-SITE.XML_ozone.scm.names=scm
OZONE-SITE.XML_ozone.scm.datanode.id.dir=/data/metadata
OZONE-SITE.XML_ozone.scm.block.client.address=scm
OZONE-SITE.XML_ozone.scm.container.size=1GB
OZONE-SITE.XML_ozone.scm.client.address=scm

OZONE-SITE.XML_hdds.datanode.dir=/data/hdds
OZONE-SITE.XML_hdds.datanode.volume.min.free.space=100MB

OZONE-SITE.XML_ozone.recon.db.dir=/data/metadata/recon
OZONE-SITE.XML_ozone.recon.om.snapshot.task.interval.delay=1m
OZONE-SITE.XML_hdds.scmclient.max.retry.timeout=30s
OZONE-SITE.XML_ozone.http.basedir=/tmp/ozone_http
OZONE-SITE.XML_ozone.fs.hsync.enabled=true

OZONE_CONF_DIR=/etc/hadoop
OZONE_LOG_DIR=/var/log/hadoop

no_proxy=om,scm,s3g,kdc,localhost,127.0.0.1

# Explicitly enable filesystem snapshot feature for this Docker compose cluster
# Does not take effect on Ozone versions < 1.4.0
OZONE-SITE.XML_ozone.filesystem.snapshot.enabled=true
30 changes: 30 additions & 0 deletions hadoop-ozone/dist/src/main/compose/upgrade/compose/non-ha/load.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

# Fail if required variables are not set.
set -u
: "${OZONE_VOLUME}"
: "${TEST_DIR}"
set +u

source "$TEST_DIR/testlib.sh"

export COMPOSE_FILE="$TEST_DIR/compose/non-ha/docker-compose.yaml"
export SECURITY_ENABLED=false
create_data_dirs "${OZONE_VOLUME}"/{om,dn1,dn2,dn3,dn4,dn5,recon,s3g,scm}

echo "Using docker cluster defined in $COMPOSE_FILE"
3 changes: 2 additions & 1 deletion hadoop-ozone/dist/src/main/compose/upgrade/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ RESULT_DIR="$ALL_RESULT_DIR" create_results_dir

# This is the version of Ozone that should use the runner image to run the
# code that was built. Other versions will pull images from docker hub.
run_test ha non-rolling-upgrade 1.4.1 "$OZONE_CURRENT_VERSION"
run_test non-ha non-rolling-upgrade 1.4.1 "$OZONE_CURRENT_VERSION"
run_test ha non-rolling-upgrade 1.4.1 "$OZONE_CURRENT_VERSION"
# run_test ha non-rolling-upgrade 1.4.0 "$OZONE_CURRENT_VERSION"
# run_test ha non-rolling-upgrade 1.3.0 "$OZONE_CURRENT_VERSION"
# run_test ha non-rolling-upgrade 1.2.1 "$OZONE_CURRENT_VERSION"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*** Settings ***
Documentation Finalize Upgrade of the Ozone cluster
Resource ../commonlib.robot
Resource lib.robot
Test Timeout 10 minutes
Test Setup Run Keyword if '${SECURITY_ENABLED}' == 'true' Kinit test user testuser testuser.keytab

Expand All @@ -25,26 +26,21 @@ Check OM Finalized
${result} = Execute env
Log ${result}
Pass Execution If '%{OZONE_UPGRADE_FROM}' == '1.1.0' OM finalization not supported in version %{OZONE_UPGRADE_FROM}
${result} = Execute ozone admin om finalizationstatus
Log ${result}
${result} = OM Finalization Status
Should Contain Any ${result} ALREADY_FINALIZED FINALIZATION_DONE

Check SCM Finalized
[Tags] scm finalized
Pass Execution If '%{OZONE_UPGRADE_FROM}' == '1.1.0' HDDS finalization not supported in version %{OZONE_UPGRADE_FROM}
${result} = Execute ozone admin scm finalizationstatus
Log ${result}
${result} = SCM Finalization Status
Should Contain Any ${result} ALREADY_FINALIZED FINALIZATION_DONE

Check OM Pre Finalized
[Tags] om pre-finalized
${result} = Execute ozone admin om finalizationstatus
Log ${result}
${result} = OM Finalization Status
Should Contain Any ${result} FINALIZATION_REQUIRED

Check SCM Pre Finalized
[Tags] scm pre-finalized
${result} = Execute ozone admin scm finalizationstatus
Log ${result}
${result} = SCM Finalization Status
Should Contain Any ${result} FINALIZATION_REQUIRED

7 changes: 3 additions & 4 deletions hadoop-ozone/dist/src/main/smoketest/upgrade/finalize.robot
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
*** Settings ***
Documentation Finalize Upgrade of the Ozone cluster
Resource ../commonlib.robot
Resource lib.robot
Test Timeout 10 minutes
Test Setup Run Keyword if '${SECURITY_ENABLED}' == 'true' Kinit test user testuser testuser.keytab

*** Test Cases ***
Finalize HDDS
${result} = Execute ozone admin scm finalizeupgrade
Log ${result}
Finalize SCM

Finalize OMs
${result} = Execute ozone admin om finalizeupgrade -id %{OM_SERVICE_ID}
Log ${result}
Finalize OM
66 changes: 66 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/upgrade/lib.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

*** Settings ***
Documentation Keywords for Upgrade Tests
Library OperatingSystem
Resource ../lib/os.robot

*** Keywords ***
Get OM Service ID
${service_id} = Get Environment Variable OM_SERVICE_ID ${EMPTY}
RETURN ${service_id}


Get OM Service Param
${service_id} = Get OM Service ID

IF '${service_id}' == ''
RETURN --service-host om
ELSE
RETURN --service-id '${service_id}'
END


OM Finalization Status
${param} = Get OM Service Param
${result} = Execute ozone admin om finalizationstatus ${param}
Log ${result}
RETURN ${result}


Finalize OM
${param} = Get OM Service Param
${result} = Execute ozone admin om finalizeupgrade ${param}
Log ${result}
RETURN ${result}


Prepare OM
${param} = Get OM Service Param
${result} = Execute ozone admin om prepare ${param}
Should contain ${result} OM Preparation successful!


SCM Finalization Status
${result} = Execute ozone admin scm finalizationstatus
Log ${result}
RETURN ${result}


Finalize SCM
${result} = Execute ozone admin scm finalizeupgrade
Log ${result}
RETURN ${result}
Loading