Skip to content

Conversation

@sarutak
Copy link
Member

@sarutak sarutak commented May 24, 2021

What changes were proposed in this pull request?

This PR adds a feature for removing pulled container image after every docker integration test finish.
This feature is enabled by the new propoerty spark.tes.docker.removePulledImage.

Why are the changes needed?

For idempotent.
I'm trying to add docker integration tests to GA in SPARK-35483 (#32631) but I noticed that jdbc.OracleIntegrationSuite consistently fails(https://github.com/sarutak/spark/runs/2646707235?check_suite_focus=true).
I investigated the reason and I found it's short of the storage capacity of the host on GA.

 ORACLE PASSWORD FOR SYS AND SYSTEM: oracle
The location '/opt/oracle' specified for database files has insufficient space.
Database creation needs at least '4.5GB' disk space.
Specify a different database file destination that has enough space in the configuration file '/etc/sysconfig/oracle-xe-18c.conf'.
mv: cannot stat '/opt/oracle/product/18c/dbhomeXE/dbs/spfileXE.ora': No such file or directory
mv: cannot stat '/opt/oracle/product/18c/dbhomeXE/dbs/orapwXE': No such file or directory
ORACLE_HOME = [/home/oracle] ? ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID .
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base remains unchanged with value /opt/oracle
#####################################
########### E R R O R ###############
DATABASE SETUP WAS NOT SUCCESSFUL!
Please check output for further info!
########### E R R O R ###############
#####################################
The following output is now a tail of the alert.log:
tail: cannot open '/opt/oracle/diag/rdbms/*/*/trace/alert*.log' for reading: No such file or directory
tail: no files remaining

With this feature, pulled container image is removed and keep the capacity for jdbc.OracleIntegrationSuite in GA.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

I confirmed the following things.

  • A container image which is absent in the local repository is removed after test finished if spark.test.container.removePulledImage is true.
  • A container image which is present in the local repository is not removed after the finished even if spark.test.container.removePulledImage is true.
  • A container image is not removed regardless of presence of the container image in the local repository even if spark.test.container.removePulledImage is true.

@SparkQA
Copy link

SparkQA commented May 24, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43394/

@SparkQA
Copy link

SparkQA commented May 24, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43394/

@SparkQA
Copy link

SparkQA commented May 24, 2021

Test build #138872 has finished for PR 32652 at commit 60ea4fd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@sarutak
Copy link
Member Author

sarutak commented May 26, 2021

cc: @dongjoon-hyun @HyukjinKwon

pom.xml Outdated
<spark.test.home>${session.executionRootDirectory}</spark.test.home>
<spark.test.webdriver.chrome.driver></spark.test.webdriver.chrome.driver>
<spark.test.docker.keepContainer>false</spark.test.docker.keepContainer>
<spark.test.docker.removePulledImage>false</spark.test.docker.removePulledImage>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should maybe just enable it by default. but I will leave it to you @sarutak and @dongjoon-hyun

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disabled it by default just for behavior compatibility (pulled images are not removed before this change).
But it may be no problem even if we enable it.

@dongjoon-hyun
Copy link
Member

Thank you for pinging me, @sarutak .

@SparkQA
Copy link

SparkQA commented May 26, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43471/

@SparkQA
Copy link

SparkQA commented May 26, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43471/

@SparkQA
Copy link

SparkQA commented May 26, 2021

Test build #138951 has finished for PR 32652 at commit da66bb1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

Merged to master.

val keepContainer =
sys.props.getOrElse("spark.test.docker.keepContainer", "false").toBoolean
val removePulledImage =
sys.props.getOrElse("spark.test.docker.removePulledImage", "true").toBoolean
Copy link
Member

@dongjoon-hyun dongjoon-hyun May 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this causes image downloading every time, this is a regression for the non-GA users, isn't it?
I'd keep the default as false and enable this true only at GitHub Action environment if that is trying to resolve GA issue.

I investigated the reason and I found it's short of the storage capacity of the host on GA.

WDYT, @sarutak and @HyukjinKwon ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid behavior change, it would be better to keep it false but keeping container images in the local repository is side effect and done implicitly before this change. So I thought it is better do keep the images only if users can explicitly set the property to false.
Any thoughts? @dongjoon-hyun @HyukjinKwon

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. If you think so, never mind. Since it's already merged, let's leave this AS-IS, @sarutak .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am okay either way. Please feel free to change if you guys have a preference 👍

<spark.test.home>${session.executionRootDirectory}</spark.test.home>
<spark.test.webdriver.chrome.driver></spark.test.webdriver.chrome.driver>
<spark.test.docker.keepContainer>false</spark.test.docker.keepContainer>
<spark.test.docker.removePulledImage>true</spark.test.docker.removePulledImage>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants