[
https://issues.apache.org/jira/browse/BEAM-7872?focusedWorklogId=300269&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-300269
]
ASF GitHub Bot logged work on BEAM-7872:
----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Aug/19 12:37
Start Date: 23/Aug/19 12:37
Worklog Time Spent: 10m
Work Description: lgajowy commented on pull request #9213: [BEAM-7872]
Simpler Flink cluster set up in load tests
URL: https://github.com/apache/beam/pull/9213#discussion_r317101318
##########
File path: .test-infra/jenkins/DockerPublisher.groovy
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+
+import CommonJobProperties as common
+
+class DockerPublisher {
+ private String repositoryRoot
+
+ DockerPublisher(String repositoryRoot =
'gcr.io/apache-beam-testing/beam_portability') {
+ this.repositoryRoot = repositoryRoot
+ }
+
+ /**
+ * Builds a Docker image from a gradle task and pushes it to the registry.
+ *
+ * @param job - jenkins job
+ * @param gradleTask - name of a Gradle task
+ * @param imageName - name of a docker image
+ * @param imageTag - tag of a docker image
+ */
+ final void publish(job, String gradleTask, String imageName, String imageTag
= 'latest') {
+ executeGradleTask(job, gradleTask, imageTag)
+ pushDockerImage(job, imageName, imageTag)
+ }
+
+ /**
+ * Returns the name of a docker image in the following format:
<repositoryRoot>/<imageName>:<imageTag>
+ *
+ * @param imageName - name of a docker image
+ * @param imageTag - tag of a docker image
+ */
+ final String getFullImageName(String imageName, String imageTag = 'latest') {
+ String image = "${repositoryRoot}/${imageName}"
+ return "${image}:${imageTag}"
+ }
+
+ private void executeGradleTask(job, String gradleTask, String imageTag) {
+ job.steps {
+ gradle {
+ rootBuildScriptDir(common.checkoutDir)
+ common.setGradleSwitches(delegate)
+ tasks(gradleTask)
+ switches("-Pdocker-repository-root=${repositoryRoot}")
+ switches("-Pdocker-tag=${imageTag}")
+ }
+ }
+ }
+
+ private void pushDockerImage(job, String imageName, String imageTag) {
Review comment:
this could be called `push` - the parameters say the rest. :)
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 300269)
Time Spent: 10h 50m (was: 10h 40m)
> Simpler Flink cluster set up in load tests
> ------------------------------------------
>
> Key: BEAM-7872
> URL: https://issues.apache.org/jira/browse/BEAM-7872
> Project: Beam
> Issue Type: Sub-task
> Components: testing
> Reporter: Kamil Wasilewski
> Assignee: Kamil Wasilewski
> Priority: Major
> Time Spent: 10h 50m
> Remaining Estimate: 0h
>
> Creating a new load test running on Flink runner could be easier by providing
> a single `setUp` function which would encapsulate the process of creating
> Flink cluster and registering teardown steps
--
This message was sent by Atlassian Jira
(v8.3.2#803003)