From 5f579b9ff74c22a8a46373ebf97f7327e905a447 Mon Sep 17 00:00:00 2001
From: fanyinbo <1553199396@qq.com>
Date: Fri, 2 Feb 2024 19:20:21 +0800
Subject: [PATCH] Bump version to v0.8.1
Signed-off-by: fanyinbo <1553199396@qq.com>
---
.ops/.gitlab-ci.yml | 2 +-
README.md | 6 ++---
backend/Dockerfile | 2 +-
backend/README.md | 2 +-
backend/pom.xml | 2 +-
.../basic/x1/usecase/UploadDataUseCase.java | 24 +++++++++++++------
6 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/.ops/.gitlab-ci.yml b/.ops/.gitlab-ci.yml
index 03ed78d7..fb702ab0 100644
--- a/.ops/.gitlab-ci.yml
+++ b/.ops/.gitlab-ci.yml
@@ -4,4 +4,4 @@ include:
variables:
APP_NAME: "xtreme1"
- APP_VERSION: "0.8"
+ APP_VERSION: "v0.8.1"
diff --git a/README.md b/README.md
index 81195446..52057037 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-![](https://img.shields.io/badge/Release-v0.8-green)
+![](https://img.shields.io/badge/Release-v0.8.1-green)
![](https://img.shields.io/badge/License-Apache%202.0-blueviolet)
[![Twitter](https://img.shields.io/badge/Follow-Twitter-blue)](https://twitter.com/Xtreme1io)
[![Online](https://img.shields.io/badge/Xtreme1_Online-App-yellow)](https://app.basic.ai/#/login)
@@ -62,8 +62,8 @@ Image Data Curation (Visualizing & Debug) - [MobileNetV3](https://github.com/xi
Download the latest release package and unzip it.
```bash
-wget https://github.com/xtreme1-io/xtreme1/releases/download/v0.8/xtreme1-v0.8.zip
-unzip -d xtreme1-v0.8 xtreme1-v0.8.zip
+wget https://github.com/xtreme1-io/xtreme1/releases/download/v0.8.1/xtreme1-v0.8.1.zip
+unzip -d xtreme1-v0.8.1 xtreme1-v0.8.1.zip
```
## Start all services
diff --git a/backend/Dockerfile b/backend/Dockerfile
index 08c5222b..3c2b0883 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -9,7 +9,7 @@ RUN apt update && \
apt install -y iputils-ping curl wget netcat python3 python3-pip git
RUN pip3 install --upgrade --force-reinstall git+https://github.com/xtreme1-io/xtreme1-sdk.git@d0cf4cc
WORKDIR /app
-COPY --from=build /build/target/xtreme1-backend-0.8-SNAPSHOT.jar ./app.jar
+COPY --from=build /build/target/xtreme1-backend-0.8.1-SNAPSHOT.jar ./app.jar
RUN mkdir -p config
RUN wget 'https://github.com/xtreme1-io/asset/raw/main/datasets/xtreme1-lidar-fusion-trial.zip' -O xtreme1-lidar-fusion-trial.zip
RUN wget 'https://github.com/xtreme1-io/asset/raw/main/datasets/xtreme1-image-trial.zip' -O xtreme1-image-trial.zip
diff --git a/backend/README.md b/backend/README.md
index 97159b53..b1843bf8 100644
--- a/backend/README.md
+++ b/backend/README.md
@@ -92,7 +92,7 @@ cd backend
mvn package
# Using local configuration to start application.
-java -Dspring.profiles.active=local -jar target/xtreme1-backend-0.8-SNAPSHOT.jar
+java -Dspring.profiles.active=local -jar target/xtreme1-backend-0.8.1-SNAPSHOT.jar
```
Now you can access the backend service at `http://localhost:8080/`.
diff --git a/backend/pom.xml b/backend/pom.xml
index 0db8095b..a1dc1ab5 100644
--- a/backend/pom.xml
+++ b/backend/pom.xml
@@ -13,7 +13,7 @@
ai.basic
xtreme1-backend
-
0.8-SNAPSHOT
+
0.8.1-SNAPSHOT
Xtreme1 Backend
diff --git a/backend/src/main/java/ai/basic/x1/usecase/UploadDataUseCase.java b/backend/src/main/java/ai/basic/x1/usecase/UploadDataUseCase.java
index d27c3b35..2b78c457 100644
--- a/backend/src/main/java/ai/basic/x1/usecase/UploadDataUseCase.java
+++ b/backend/src/main/java/ai/basic/x1/usecase/UploadDataUseCase.java
@@ -304,6 +304,7 @@ public void parseTextUploadFile(DataInfoUploadBO dataInfoUploadBO) {
var rootPath = String.format("%s/%s", userId, datasetId);
var errorBuilder = new StringBuilder();
var dataInfoBOBuilder = DataInfoBO.builder().datasetId(datasetId)
+ .parentId(Constants.DEFAULT_PARENT_ID)
.type(ItemTypeEnum.SINGLE_DATA)
.status(DataStatusEnum.VALID)
.annotationStatus(DataAnnotationStatusEnum.NOT_ANNOTATED)
@@ -349,7 +350,7 @@ public void parseTextUploadFile(DataInfoUploadBO dataInfoUploadBO) {
dataInfoBOList.add(dataInfoBO);
});
if (CollectionUtil.isNotEmpty(dataInfoBOList)) {
- insertBatch(dataInfoBOList, datasetId, errorBuilder);
+ insertBatch(dataInfoBOList, datasetId, errorBuilder, Constants.DEFAULT_PARENT_ID);
}
} catch (Exception e) {
log.error("Handle data error", e);
@@ -463,7 +464,15 @@ public void commonParseUploadFile(DataInfoUploadBO dataInfoUploadBO, BiConsumer<
var dataAnnotationObjectBOBuilder = DataAnnotationObjectBO.builder()
.datasetId(datasetId).createdBy(userId).createdAt(OffsetDateTime.now()).sourceId(sourceId);
sceneFileList.forEach(sceneFile -> {
- var sceneId = this.saveScene(sceneFile, dataInfoUploadBO);
+ Long sceneId;
+ try {
+ sceneId = this.saveScene(sceneFile, dataInfoUploadBO);
+ } catch (DuplicateKeyException e) {
+ log.error("The scene already exists,scene name is {}", sceneFile.getName());
+ errorBuilder.append("Duplicate scene names:").append(sceneFile.getName()).append(";");
+ return;
+ }
+
var dataNameList = getDataNamesFunction.apply(sceneFile);
if (CollectionUtil.isEmpty(dataNameList)) {
log.error("The file in {} folder is empty", sceneFile);
@@ -498,7 +507,7 @@ public void commonParseUploadFile(DataInfoUploadBO dataInfoUploadBO, BiConsumer<
}
});
if (CollectionUtil.isNotEmpty(dataInfoBOList)) {
- var resDataInfoList = this.insertBatch(dataInfoBOList, datasetId, errorBuilder);
+ var resDataInfoList = this.insertBatch(dataInfoBOList, datasetId, errorBuilder, sceneId);
this.saveBatchDataResult(resDataInfoList, dataAnnotationObjectBOList);
}
} catch (Exception e) {
@@ -1045,9 +1054,9 @@ public String getFilename(File file) {
*
* @param dataInfoBOList Collection of data details
*/
- public List
insertBatch(List dataInfoBOList, Long datasetId, StringBuilder errorBuilder) {
+ public List insertBatch(List dataInfoBOList, Long datasetId, StringBuilder errorBuilder, Long parentId) {
var names = dataInfoBOList.stream().map(DataInfoBO::getName).collect(Collectors.toList());
- var existDataInfoList = this.findByNames(datasetId, names);
+ var existDataInfoList = this.findByNames(datasetId, parentId, names);
if (CollUtil.isNotEmpty(existDataInfoList)) {
var existNames = existDataInfoList.stream().map(DataInfoBO::getName).collect(Collectors.toList());
dataInfoBOList = dataInfoBOList.stream().filter(dataInfoBO -> !existNames.contains(dataInfoBO.getName())).collect(Collectors.toList());
@@ -1071,10 +1080,11 @@ public List insertBatch(List dataInfoBOList, Long datase
}
}
- private List findByNames(Long datasetId, List names) {
+ private List findByNames(Long datasetId, Long parentId, List names) {
var dataInfoLambdaQueryWrapper = Wrappers.lambdaQuery(DataInfo.class);
dataInfoLambdaQueryWrapper.eq(DataInfo::getDatasetId, datasetId);
dataInfoLambdaQueryWrapper.in(DataInfo::getName, names);
+ dataInfoLambdaQueryWrapper.eq(DataInfo::getParentId, parentId);
return DefaultConverter.convert(dataInfoDAO.list(dataInfoLambdaQueryWrapper), DataInfoBO.class);
}
@@ -1145,4 +1155,4 @@ private void getLeafNodeList(List> treeNodes, List> le
}
});
}
-}
+}
\ No newline at end of file