Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SingleStoreIO #23535

Merged
merged 49 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
cf70914
check point
AdalbertMemSQL Sep 16, 2022
c9b78ae
SingleStoreIO
AdalbertMemSQL Oct 7, 2022
dd4f9e8
Added licenses and fixed formatting errors
AdalbertMemSQL Oct 18, 2022
4bcbd90
Fixed identation and deleted nullable checks
AdalbertMemSQL Oct 18, 2022
000bc99
Delted unused function
AdalbertMemSQL Oct 18, 2022
7fddc99
Fixed identation one more time
AdalbertMemSQL Oct 18, 2022
2db3d31
Added Nullable definition to the Read PTransform
AdalbertMemSQL Oct 19, 2022
92ef537
Trying to fix Nullable errors
AdalbertMemSQL Oct 19, 2022
a2cfe69
Added Nullable definition to the ReadWithPartitions and Write, added …
AdalbertMemSQL Oct 19, 2022
563cf54
Added functions to util to operate with nullable parameters
AdalbertMemSQL Oct 19, 2022
9522dd5
Added Nullable definitions to the DataSourceConfiguration
AdalbertMemSQL Oct 19, 2022
861ea3c
Fixed Nullable error
AdalbertMemSQL Oct 19, 2022
05cf827
Closed Connection, Statement and ResultSet in other way as SpotBugs r…
AdalbertMemSQL Oct 19, 2022
f9194ce
Added population of the display data
AdalbertMemSQL Oct 19, 2022
b43c8aa
Fixed AmbiguousMethodReference error
AdalbertMemSQL Oct 19, 2022
e96bd08
Saved results of the perf test to the influxdb
AdalbertMemSQL Oct 19, 2022
591ff2e
reformatted test
AdalbertMemSQL Oct 19, 2022
9c94f01
Fixed nit bugs
AdalbertMemSQL Oct 20, 2022
4478610
Changed default batch size, changed UserDataMapper interface, added c…
AdalbertMemSQL Oct 20, 2022
da856eb
Added unit test for Util
AdalbertMemSQL Oct 21, 2022
4c4cf14
Added license
AdalbertMemSQL Oct 21, 2022
9e619fd
Added Read unit test
AdalbertMemSQL Oct 21, 2022
6132f7e
Added more unit tests
AdalbertMemSQL Oct 26, 2022
3699301
Added unit test for DataSourceConfiguration
AdalbertMemSQL Oct 26, 2022
31e4efd
Fixed identation
AdalbertMemSQL Oct 26, 2022
38a2214
Fixed style check errors, added comments
AdalbertMemSQL Oct 26, 2022
36896c3
Added more comments
AdalbertMemSQL Oct 26, 2022
2a82aab
Deleted posibility to set coder
AdalbertMemSQL Oct 26, 2022
520720e
Fixed identation
AdalbertMemSQL Oct 26, 2022
da66f40
Removed ValueProviders as suggested in this comment https://github.co…
AdalbertMemSQL Nov 9, 2022
6fec318
Renamed Util to SingleStoreUtil
AdalbertMemSQL Nov 9, 2022
98ed0d3
Changed Write to return number of written rows by each query
AdalbertMemSQL Nov 9, 2022
139c2f7
Used org.apache.beam.sdk.util.Preconditions to check arguments
AdalbertMemSQL Nov 9, 2022
d68acb6
Moved dependencies to the BeamModulePlugin.groovy
AdalbertMemSQL Nov 10, 2022
1a46cb4
Added class level comments
AdalbertMemSQL Nov 10, 2022
fe42b79
Reformatted comments
AdalbertMemSQL Nov 10, 2022
4d3d634
Moved all PTransforms and interfaces into the SingleStoreIO class
AdalbertMemSQL Nov 14, 2022
d2c2293
Updated CHANGES.md
AdalbertMemSQL Nov 14, 2022
cf7e11d
Changed permissions of wait-for.sh script
AdalbertMemSQL Nov 14, 2022
b44d8cb
Changed to use LOAD_BALANCER_IP env variable instead of LOAD_BALANCER…
AdalbertMemSQL Nov 14, 2022
d0364bf
Deleted SingleStore_IO_Direct test
AdalbertMemSQL Nov 14, 2022
aa6f893
Changed to use dataflow runner instead of direct runner
AdalbertMemSQL Nov 14, 2022
ef37828
Added runner in the pipelineOptions to be consistent with other tests
AdalbertMemSQL Nov 14, 2022
9db5423
Added tempRoot and project to pipelineOptions
AdalbertMemSQL Nov 14, 2022
a8bdd02
Resolved comments
AdalbertMemSQL Nov 15, 2022
05a4b6a
Increased number of records in the integration test to 10M
AdalbertMemSQL Nov 15, 2022
b25f096
Added asserts that pipeline status is DONE
AdalbertMemSQL Nov 16, 2022
3680dd4
Set supported numberOfRecords for hash
Abacn Nov 16, 2022
ca842ff
Change SingleStoreIO to be public and SingleStoreUtil to be final
AdalbertMemSQL Nov 16, 2022
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
86 changes: 86 additions & 0 deletions .test-infra/jenkins/job_PerformanceTests_SingleStoreIO.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* 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
import Kubernetes
import InfluxDBCredentialsHelper

String jobName = "beam_PerformanceTests_SingleStoreIO"

void waitForPodWithLabel(job, Kubernetes k8s, String label) {
job.steps {
shell("${k8s.KUBERNETES_DIR}/singlestore/wait-for-pod-with-label.sh ${label} 600")
}
}

void waitFor(job, Kubernetes k8s, String resource) {
job.steps {
shell("${k8s.KUBERNETES_DIR}/singlestore/wait-for.sh ${resource} 600")
}
}

job(jobName) {
common.setTopLevelMainJobProperties(delegate)
common.setAutoJob(delegate,'H H/6 * * *')
common.enablePhraseTriggeringFromPullRequest(
delegate,
'Java SingleStoreIO Performance Test',
'Run Java SingleStoreIO Performance Test')
InfluxDBCredentialsHelper.useCredentials(delegate)


String namespace = common.getKubernetesNamespace(jobName)
String kubeconfigPath = common.getKubeconfigLocationForNamespace(namespace)
Kubernetes k8s = Kubernetes.create(delegate, kubeconfigPath, namespace)

k8s.apply(common.makePathAbsolute("src/.test-infra/kubernetes/singlestore/sdb-rbac.yaml"))
k8s.apply(common.makePathAbsolute("src/.test-infra/kubernetes/singlestore/sdb-cluster-crd.yaml"))
k8s.apply(common.makePathAbsolute("src/.test-infra/kubernetes/singlestore/sdb-operator.yaml"))
waitForPodWithLabel(delegate, k8s, "sdb-operator")

k8s.apply(common.makePathAbsolute("src/.test-infra/kubernetes/singlestore/sdb-cluster.yaml"))
waitFor(delegate, k8s, "memsqlclusters.memsql.com")

String singlestoreHostName = "LOAD_BALANCER_IP"
k8s.loadBalancerIP("svc-sdb-cluster-ddl", singlestoreHostName)

Map pipelineOptions = [
tempRoot : 'gs://temp-storage-for-perf-tests',
project : 'apache-beam-testing',
runner : 'DataflowRunner',
singleStoreServerName : "\$${singlestoreHostName}",
singleStoreUsername : "admin",
singleStorePassword : "secretpass",
singleStorePort: "3306",
numberOfRecords: "5000000",
influxMeasurement : 'singlestoreioit_results',
influxDatabase : InfluxDBCredentialsHelper.InfluxDBDatabaseName,
influxHost : InfluxDBCredentialsHelper.InfluxDBHostUrl
]

steps {
gradle {
rootBuildScriptDir(common.checkoutDir)
common.setGradleSwitches(delegate)
switches("--info")
switches("-DintegrationTestPipelineOptions=\'${common.joinPipelineOptions(pipelineOptions)}\'")
switches("-DintegrationTestRunner=dataflow")
tasks(":sdks:java:io:singlestore:integrationTest --tests org.apache.beam.sdk.io.singlestore.SingleStoreIOIT")
}
}
}
78 changes: 78 additions & 0 deletions .test-infra/kubernetes/singlestore/sdb-cluster-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# 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.

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: memsqlclusters.memsql.com
spec:
group: memsql.com
names:
kind: MemsqlCluster
listKind: MemsqlClusterList
plural: memsqlclusters
singular: memsqlcluster
shortNames:
- singlestore
- singlestoredb
- memsql
scope: Namespaced
versions:
- name: v1alpha1
served: true
storage: true
schema:
openAPIV3Schema:
description: Schema for the SingleStoreDB Cluster
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec defines the desired state of Cluster
type: object
x-kubernetes-preserve-unknown-fields: true
status:
description: Status defines the observed state of Cluster
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
subresources:
status: {}
additionalPrinterColumns:
- name: Aggregators
type: integer
description: Number of Aggregators
jsonPath: .status.expectedAggregators
- name: Leaves
type: integer
description: Number of Leaf Nodes (per availability group)
jsonPath: .status.expectedLeaves
- name: Redundancy Level
type: integer
description: Redundancy level of the Cluster
jsonPath: .spec.redundancyLevel
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
54 changes: 54 additions & 0 deletions .test-infra/kubernetes/singlestore/sdb-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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.

apiVersion: memsql.com/v1alpha1
kind: MemsqlCluster
metadata:
name: sdb-cluster
spec:
license: BGU3OTg5NmYxYTNiNTRkOGNiNDkwNzMyYTQ5ZTE1ZTAzAAAAAAAAAAAEAAAAAAAAAAwwNgIZALALmsXqagDEX93vkSHbvgzqrTfx5n6oTgIZAN3u0cviuZmqfYvFHGFfFy85cg2XSnrnHw==
adminHashedPassword: "*9177CC8207174BDBB5ED66B2140C75171283F15D"
nodeImage:
repository: singlestore/node
tag: alma-7.5.22-8b82f8a84e

redundancyLevel: 1

serviceSpec:
objectMetaOverrides:
labels:
custom: label
annotations:
custom: annotations

aggregatorSpec:
count: 1
height: 0.5
storageGB: 16
storageClass: standard

objectMetaOverrides:
labels:
name: node-sdb-cluster-master

leafSpec:
count: 1
height: 0.5
storageGB: 32
storageClass: standard

objectMetaOverrides:
labels:
name: node-sdb-cluster-leaf
58 changes: 58 additions & 0 deletions .test-infra/kubernetes/singlestore/sdb-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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.

apiVersion: apps/v1
kind: Deployment
metadata:
name: sdb-operator
labels:
app.kubernetes.io/component: operator
spec:
replicas: 1
selector:
matchLabels:
name: sdb-operator
template:
metadata:
labels:
name: sdb-operator
spec:
serviceAccountName: sdb-operator
containers:
- name: sdb-operator
image: singlestore/operator:3.0.32-db8f5aff
imagePullPolicy: Always
args: [
# Cause the operator to merge rather than replace annotations on services
"--merge-service-annotations",
# Allow the process inside the container to have read/write access to the `/var/lib/memsql` volume.
"--fs-group-id", "5555",
"--cluster-id", "sdb-cluster",

# Args below are for local dev
"--cores-per-unit", "0",
"--memory-per-unit", "0"
]
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "sdb-operator"
102 changes: 102 additions & 0 deletions .test-infra/kubernetes/singlestore/sdb-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# 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.

apiVersion: v1
kind: ServiceAccount
metadata:
name: sdb-operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: sdb-operator
rules:
- apiGroups:
- ""
resources:
- pods
- services
- endpoints
- persistentvolumeclaims
- events
- configmaps
- secrets
verbs:
- '*'
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- '*'
- apiGroups:
- batch
resources:
- cronjobs
verbs:
- '*'
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- apiGroups:
- apps
- extensions
resources:
- deployments
- daemonsets
- replicasets
- statefulsets
- statefulsets/status
verbs:
- '*'
- apiGroups:
- memsql.com
resources:
- '*'
verbs:
- '*'
- apiGroups:
- networking.k8s.io
resources:
- networkpolicies
verbs:
- '*'
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: sdb-operator
subjects:
- kind: ServiceAccount
name: sdb-operator
roleRef:
kind: Role
name: sdb-operator
apiGroup: rbac.authorization.k8s.io
Loading