You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ke...@apache.org on 2017/03/09 00:13:37 UTC
[2/3] beam git commit: Jdbc k8 & data loading: add teardown and
update names/docs
Jdbc k8 & data loading: add teardown and update names/docs
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/32e17d4d
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/32e17d4d
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/32e17d4d
Branch: refs/heads/master
Commit: 32e17d4d6a84e349cc55732371245e8ad126a747
Parents: 5d120bd
Author: Stephen Sisk <si...@google.com>
Authored: Mon Mar 6 15:59:31 2017 -0800
Committer: Kenneth Knowles <kl...@google.com>
Committed: Wed Mar 8 16:12:16 2017 -0800
----------------------------------------------------------------------
sdks/java/io/jdbc/src/test/README.md | 32 ++++++++++++++++++++
.../beam/sdk/io/jdbc/JdbcTestDataSet.java | 3 +-
.../kubernetes/setup-postgres-service.sh | 20 ------------
.../jdbc/src/test/resources/kubernetes/setup.sh | 20 ++++++++++++
.../src/test/resources/kubernetes/teardown.sh | 20 ++++++++++++
5 files changed, 74 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/beam/blob/32e17d4d/sdks/java/io/jdbc/src/test/README.md
----------------------------------------------------------------------
diff --git a/sdks/java/io/jdbc/src/test/README.md b/sdks/java/io/jdbc/src/test/README.md
new file mode 100644
index 0000000..5a7ac99
--- /dev/null
+++ b/sdks/java/io/jdbc/src/test/README.md
@@ -0,0 +1,32 @@
+<!--
+ 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.
+-->
+
+These are instructions for maintaining postgres as needed for Integration Tests (JdbcIOIT).
+
+You can always ignore these instructions if you have your own postgres cluster to test against.
+
+Setting up Postgres
+-------------------
+1. Setup kubectl so it is configured to work with your kubernetes cluster
+1. Run the postgres setup script
+ src/test/resources/kubernetes/setup.sh
+1. Do the data loading - create the data store instance by following the instructions in JdbcTestDataSet
+
+... and your postgres instances are set up!
+
http://git-wip-us.apache.org/repos/asf/beam/blob/32e17d4d/sdks/java/io/jdbc/src/test/java/org/apache/beam/sdk/io/jdbc/JdbcTestDataSet.java
----------------------------------------------------------------------
diff --git a/sdks/java/io/jdbc/src/test/java/org/apache/beam/sdk/io/jdbc/JdbcTestDataSet.java b/sdks/java/io/jdbc/src/test/java/org/apache/beam/sdk/io/jdbc/JdbcTestDataSet.java
index 11cc2be..2a5d6f4 100644
--- a/sdks/java/io/jdbc/src/test/java/org/apache/beam/sdk/io/jdbc/JdbcTestDataSet.java
+++ b/sdks/java/io/jdbc/src/test/java/org/apache/beam/sdk/io/jdbc/JdbcTestDataSet.java
@@ -41,8 +41,9 @@ public class JdbcTestDataSet {
* Use this to create the read tables before IT read tests.
*
* <p>To invoke this class, you can use this command line:
+ * (run from the jdbc root directory)
* mvn test-compile exec:java -Dexec.mainClass=org.apache.beam.sdk.io.jdbc.JdbcTestDataSet \
- * -Dexec.args="--postgresIp=1.1.1.1 --postgresUsername=postgres
+ * -Dexec.args="--postgresServerName=127.0.0.1 --postgresUsername=postgres \
* --postgresDatabaseName=myfancydb \
* --postgresPassword=yourpassword --postgresSsl=false" \
* -Dexec.classpathScope=test
http://git-wip-us.apache.org/repos/asf/beam/blob/32e17d4d/sdks/java/io/jdbc/src/test/resources/kubernetes/setup-postgres-service.sh
----------------------------------------------------------------------
diff --git a/sdks/java/io/jdbc/src/test/resources/kubernetes/setup-postgres-service.sh b/sdks/java/io/jdbc/src/test/resources/kubernetes/setup-postgres-service.sh
deleted file mode 100644
index eece773..0000000
--- a/sdks/java/io/jdbc/src/test/resources/kubernetes/setup-postgres-service.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/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.
-#
-
-kubectl.sh create -f postgres-pod-no-vol.yml
-kubectl.sh create -f postgres-service-public.yml
http://git-wip-us.apache.org/repos/asf/beam/blob/32e17d4d/sdks/java/io/jdbc/src/test/resources/kubernetes/setup.sh
----------------------------------------------------------------------
diff --git a/sdks/java/io/jdbc/src/test/resources/kubernetes/setup.sh b/sdks/java/io/jdbc/src/test/resources/kubernetes/setup.sh
new file mode 100644
index 0000000..7d9b2e2
--- /dev/null
+++ b/sdks/java/io/jdbc/src/test/resources/kubernetes/setup.sh
@@ -0,0 +1,20 @@
+#!/bin/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.
+#
+
+kubectl create -f postgres-pod-no-vol.yml
+kubectl create -f postgres-service-public.yml
http://git-wip-us.apache.org/repos/asf/beam/blob/32e17d4d/sdks/java/io/jdbc/src/test/resources/kubernetes/teardown.sh
----------------------------------------------------------------------
diff --git a/sdks/java/io/jdbc/src/test/resources/kubernetes/teardown.sh b/sdks/java/io/jdbc/src/test/resources/kubernetes/teardown.sh
new file mode 100644
index 0000000..451562e
--- /dev/null
+++ b/sdks/java/io/jdbc/src/test/resources/kubernetes/teardown.sh
@@ -0,0 +1,20 @@
+#!/bin/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.
+#
+
+kubectl delete service postgres-no-pv
+kubectl delete pod postgres-no-pv