-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][scaleph-engine-doris] add doris template detail web (#650)
* fix: doris template step form item error * feature: add doris template yaml step * feature: add doris template yaml step * feature: add createStatus for doris template * feature: add yaml step for doris template steps * feature: add yaml step for doris template steps * feature: add yaml step for doris template steps * feature: remove doris template createStatus field * feature: refactor doris template step model * feature: add yaml area for doris template detail web * feature: add yaml area for doris template detail web
- Loading branch information
Showing
26 changed files
with
802 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
...ine-doris/src/main/java/cn/sliew/scaleph/engine/doris/service/resource/DorisTemplate.java
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
.../src/main/java/cn/sliew/scaleph/engine/doris/service/resource/template/DorisTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 cn.sliew.scaleph.engine.doris.service.resource.template; | ||
|
||
import cn.sliew.scaleph.engine.doris.operator.spec.DorisClusterSpec; | ||
import cn.sliew.scaleph.engine.doris.operator.status.DorisClusterStatus; | ||
import cn.sliew.scaleph.kubernetes.Constant; | ||
import cn.sliew.scaleph.kubernetes.resource.Resource; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
import io.fabric8.kubernetes.client.CustomResource; | ||
import io.fabric8.kubernetes.model.annotation.Group; | ||
import io.fabric8.kubernetes.model.annotation.Version; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
@Data | ||
@Group(Constant.SCALEPH_GROUP) | ||
@Version(Constant.SCALEPH_VERSION) | ||
@EqualsAndHashCode | ||
@JsonPropertyOrder({"apiVersion", "kind", "metadata", "spec", "status"}) | ||
public class DorisTemplate extends CustomResource<DorisClusterSpec, DorisClusterStatus> implements Resource { | ||
} |
72 changes: 72 additions & 0 deletions
72
.../java/cn/sliew/scaleph/engine/doris/service/resource/template/DorisTemplateConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* 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 cn.sliew.scaleph.engine.doris.service.resource.template; | ||
|
||
import cn.sliew.scaleph.config.resource.ResourceLabels; | ||
import cn.sliew.scaleph.engine.doris.operator.spec.DorisClusterSpec; | ||
import cn.sliew.scaleph.engine.doris.service.dto.WsDorisTemplateDTO; | ||
import cn.sliew.scaleph.kubernetes.resource.ResourceConverter; | ||
import io.fabric8.kubernetes.api.model.ObjectMetaBuilder; | ||
import org.springframework.util.StringUtils; | ||
|
||
import java.util.Map; | ||
|
||
public enum DorisTemplateConverter implements ResourceConverter<WsDorisTemplateDTO, DorisTemplate> { | ||
INSTANCE; | ||
|
||
@Override | ||
public DorisTemplate convertTo(WsDorisTemplateDTO source) { | ||
DorisTemplate template = new DorisTemplate(); | ||
ObjectMetaBuilder builder = new ObjectMetaBuilder(true); | ||
String name = StringUtils.hasText(source.getTemplateId()) ? source.getTemplateId() : source.getName(); | ||
builder.withName(name); | ||
builder.withNamespace(source.getNamespace()); | ||
builder.withLabels(Map.of(ResourceLabels.SCALEPH_LABEL_NAME, source.getName())); | ||
template.setMetadata(builder.build()); | ||
DorisClusterSpec spec = new DorisClusterSpec(); | ||
spec.setFeSpec(source.getFeSpec()); | ||
spec.setBeSpec(source.getBeSpec()); | ||
spec.setCnSpec(source.getCnSpec()); | ||
spec.setBrokerSpec(source.getBrokerSpec()); | ||
spec.setAdminUser(source.getAdmin()); | ||
template.setSpec(spec); | ||
return template; | ||
} | ||
|
||
@Override | ||
public WsDorisTemplateDTO convertFrom(DorisTemplate target) { | ||
WsDorisTemplateDTO dto = new WsDorisTemplateDTO(); | ||
String name = target.getMetadata().getName(); | ||
if (target.getMetadata().getLabels() != null) { | ||
Map<String, String> labels = target.getMetadata().getLabels(); | ||
name = labels.computeIfAbsent(ResourceLabels.SCALEPH_LABEL_NAME, key -> target.getMetadata().getName()); | ||
} | ||
dto.setName(name); | ||
dto.setTemplateId(target.getMetadata().getName()); | ||
dto.setNamespace(target.getMetadata().getNamespace()); | ||
|
||
DorisClusterSpec spec = target.getSpec(); | ||
dto.setFeSpec(spec.getFeSpec()); | ||
dto.setBeSpec(spec.getBeSpec()); | ||
dto.setCnSpec(spec.getCnSpec()); | ||
dto.setBrokerSpec(spec.getBrokerSpec()); | ||
dto.setAdmin(spec.getAdminUser()); | ||
return dto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.