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

[DSIP-19] Change the datasource center to the connection center #14978

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d596593
support for zeppelin connections in the connection center and externa…
xdu-chenrj Jun 30, 2023
ff051a2
synchronized the code and resolved conflicts, as well as formatted th…
xdu-chenrj Jul 1, 2023
ab40648
repaired the method for retrieving task types
xdu-chenrj Jul 3, 2023
c0bf072
recovered code with incorrect changes
xdu-chenrj Jul 8, 2023
925ba11
added zeppelin connection UT and formatted the code
xdu-chenrj Jul 8, 2023
9e4ca63
fixed zeppelin connection UT
xdu-chenrj Jul 12, 2023
5786db1
merge the latest code
xdu-chenrj Jul 12, 2023
0b8078d
recovered incorrect modifications
xdu-chenrj Jul 12, 2023
1a638bb
recovered incorrect modifications
xdu-chenrj Jul 12, 2023
fbc0c7b
Merge branch 'dev' into dev
xdu-chenrj Jul 13, 2023
1d06f31
fixed zeppelin task UT
xdu-chenrj Jul 13, 2023
d2f9924
fixed zeppelin task UT
xdu-chenrj Jul 13, 2023
afc18ba
Merge branch 'dev' into dev
xdu-chenrj Jul 13, 2023
2495f51
Merge remote-tracking branch 'upstream/dev' into dev
xdu-chenrj Jul 13, 2023
ac70b80
Merge branch 'dev' into dev
xdu-chenrj Jul 15, 2023
71d8ec6
Merge branch 'dev' into dev
xdu-chenrj Jul 17, 2023
3976a0f
Merge branch 'dev' into dev
EricGao888 Jul 17, 2023
5f1e3bc
Merge branch 'dev' into dev
xdu-chenrj Jul 19, 2023
444265f
Merge branch 'dev' into dev
xdu-chenrj Jul 20, 2023
9f4a0f0
fixed zeppelin task UT
xdu-chenrj Jul 20, 2023
50fb4cb
fixed zeppelin task UT
xdu-chenrj Jul 20, 2023
936a98c
resolved the conflict
xdu-chenrj Jul 20, 2023
a335054
modified zeppelin code
xdu-chenrj Jul 20, 2023
ec92af1
Merge branch 'dev' into dev
EricGao888 Jul 20, 2023
036fda4
Merge branch 'dev' into dev
xdu-chenrj Jul 21, 2023
62aa088
resolved the conflict
xdu-chenrj Aug 2, 2023
779af0c
resolved the conflict
xdu-chenrj Sep 14, 2023
b8165a4
supported zeppelin connection
xdu-chenrj Sep 14, 2023
b70d342
Merge remote-tracking branch 'upstream/dev' into dev
xdu-chenrj Sep 18, 2023
e43e8b4
Merge remote-tracking branch 'upstream/dev' into dev
xdu-chenrj Sep 23, 2023
47bdc47
partial sagemaker
xdu-chenrj Sep 28, 2023
d4dc63e
partial sagemaker
xdu-chenrj Sep 28, 2023
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
7 changes: 7 additions & 0 deletions dolphinscheduler-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
<protobuf.version>3.17.2</protobuf.version>
<esdk-obs.version>3.23.3</esdk-obs.version>
<system-lambda.version>1.2.1</system-lambda.version>
<zeppelin-client.version>0.10.1</zeppelin-client.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -892,6 +893,12 @@
<version>${snowflake-jdbc.version}</version>
</dependency>

<dependency>
<groupId>org.apache.zeppelin</groupId>
<artifactId>zeppelin-client</artifactId>
<version>${zeppelin-client.version}</version>
</dependency>

<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@
<artifactId>dolphinscheduler-datasource-vertica</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-datasource-zeppelin</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-datasource-plugin</artifactId>
<version>dev-SNAPSHOT</version>
</parent>

<groupId>org.apache.dolphinscheduler-plugin</groupId>
<artifactId>dolphinscheduler-datasource-sagemaker</artifactId>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-spi</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-datasource-api</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-sagemaker</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* 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.
*/

package org.apache.dolphinscheduler.plugin.datasource.sagemaker;

import static com.google.common.base.Preconditions.checkNotNull;

import lombok.extern.slf4j.Slf4j;

import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.sagemaker.AmazonSageMaker;
import com.amazonaws.services.sagemaker.AmazonSageMakerClientBuilder;
import com.amazonaws.services.sagemaker.model.ListNotebookInstancesRequest;

@Slf4j
public class SagemakerClientWrapper implements AutoCloseable {

private AmazonSageMaker amazonSageMaker;

public SagemakerClientWrapper(String accessKey, String secretAccessKey, String region) {
checkNotNull(accessKey, "sagemaker accessKey cannot be null");
checkNotNull(secretAccessKey, "sagemaker secretAccessKey cannot be null");
checkNotNull(region, "sagemaker region cannot be null");

final BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials(accessKey, secretAccessKey);
final AWSCredentialsProvider awsCredentialsProvider = new AWSStaticCredentialsProvider(basicAWSCredentials);
// create a SageMaker client
amazonSageMaker = AmazonSageMakerClientBuilder.standard().withCredentials(awsCredentialsProvider)
.withRegion(region).build();
}

public boolean checkConnect() {
try {
// If listing notebook instances fails, an exception will be thrown directly
ListNotebookInstancesRequest request = new ListNotebookInstancesRequest();
amazonSageMaker.listNotebookInstances(request);
log.info("sagemaker client connects to server successfully");
return true;
} catch (Exception e) {
log.info("sagemaker client failed to connect to the server");
}
return false;
}

@Override
public void close() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* 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.
*/

package org.apache.dolphinscheduler.plugin.datasource.sagemaker;

import org.apache.dolphinscheduler.spi.datasource.AdHocDataSourceClient;
import org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
import org.apache.dolphinscheduler.spi.datasource.PooledDataSourceClient;
import org.apache.dolphinscheduler.spi.enums.DbType;

public class SagemakerDataSourceChannel implements DataSourceChannel {

@Override
public AdHocDataSourceClient createAdHocDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
throw new UnsupportedOperationException("Sagemaker AdHocDataSourceClient is not supported");
}

@Override
public PooledDataSourceClient createPooledDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {
throw new UnsupportedOperationException("Sagemaker AdHocDataSourceClient is not supported");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.
*/

package org.apache.dolphinscheduler.plugin.datasource.sagemaker;

import org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;
import org.apache.dolphinscheduler.spi.datasource.DataSourceChannelFactory;

import com.google.auto.service.AutoService;

@AutoService(DataSourceChannelFactory.class)
public class SagemakerDataSourceChannelFactory implements DataSourceChannelFactory {

@Override
public DataSourceChannel create() {
return new SagemakerDataSourceChannel();
}

@Override
public String getName() {
return "sagemaker";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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.
*/

package org.apache.dolphinscheduler.plugin.datasource.sagemaker.param;

import org.apache.dolphinscheduler.spi.datasource.ConnectionParam;

import lombok.Data;

import com.fasterxml.jackson.annotation.JsonInclude;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SagemakerConnectionParam implements ConnectionParam {

protected String accessKey;

protected String secretAccessKey;

protected String region;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.
*/

package org.apache.dolphinscheduler.plugin.datasource.sagemaker.param;

import org.apache.dolphinscheduler.plugin.datasource.api.datasource.BaseDataSourceParamDTO;
import org.apache.dolphinscheduler.spi.enums.DbType;

import lombok.Data;

@Data
public class SagemakerDataSourceParamDTO extends BaseDataSourceParamDTO {

protected String accessKey;

protected String secretAccessKey;

protected String region;

@Override
public DbType getType() {
return DbType.SAGEMAKER;
}
}
Loading
Loading