Skip to content

Commit

Permalink
feat: proxy从backend中拆分 TencentBlueKing#1799
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoxuwan committed Feb 29, 2024
1 parent 76cb947 commit 7f4e44c
Show file tree
Hide file tree
Showing 40 changed files with 546 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/backend/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,4 @@ includeAll(":ddc")
includeAll(":svn")
includeAll(":archive")
includeAll(":s3")
includeAll(":proxy")
includeAll(":router-controller")
17 changes: 17 additions & 0 deletions src/proxy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.idea/
.gradle/
build/
target/
out/
release/
reports/
*.iml
.DS_Store
*.log
node_modules/

data/
logs/
runtime/
http-client.private.env.json
.codecc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
*/

dependencies {
api(project(":auth:api-auth"))
api(project(":generic:api-generic"))
api("com.tencent.bk.repo:api-auth")
api("com.tencent.bk.repo:api-generic")
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
*/

dependencies {
implementation(project(":proxy:api-proxy"))
implementation(project(":common:common-service"))
implementation(project(":common:common-security"))
implementation(project(":common:common-artifact:artifact-service"))
implementation(project(":api-proxy"))
implementation("com.tencent.bk.repo:common-service")
implementation("com.tencent.bk.repo:common-security")
implementation("com.tencent.bk.repo:artifact-service")
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class ProxySyncFileVisitor(
val storageKey = if (syncFile.length() == 0L) null else syncFile.readText()

val sha256 = file.canonicalPath.split(File.separator).last()
// val url = "$gateway:25903/proxy/replica/blob/push"
val url = "$gateway/replication/proxy/replica/blob/push"
logger.info("start sync file[${file.canonicalPath}]")
val inputStream = if (rate > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
*/

dependencies {
implementation(project(":proxy:biz-proxy"))
implementation(project(":biz-proxy"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#


bkrepo.proxy.project.id=##projectId##
bkrepo.proxy.name=##name##
bkrepo.proxy.secret.key=##secretKey##
bkrepo.proxy.cluster.name=##clusterName##
bkrepo.gateway=##gateway##

74 changes: 74 additions & 0 deletions src/proxy/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

plugins {
id("com.tencent.devops.boot") version Versions.DevopsBoot
id("com.tencent.devops.publish") version Versions.DevopsBoot apply false
}

allprojects {
group=Release.Group
version=Release.Version


repositories {
// for debug devops-boot locally
mavenLocal()
maven("https://oss.sonatype.org/content/repositories/snapshots/")
mavenCentral()
}

apply(plugin = "com.tencent.devops.boot")

configurations.all {
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.MINUTES)
}

dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-sleuth-otel-dependencies:${Versions.SleuthOtel}")
}
dependencies {
val bkrepoVersion = System.getProperty("bkrepo_version") ?: Versions.BkRepo
dependencySet("com.tencent.bk.repo:$bkrepoVersion") {
entry("api-auth")
entry("api-generic")
entry("common-service")
entry("common-security")
entry("artifact-service")
}
dependency("org.apache.commons:commons-text:${Versions.CommonsText}")
dependency("com.tencent.polaris:polaris-discovery-factory:${Versions.Polaris}")
dependency("com.tencent.bk.sdk:crypto-java-sdk:${Versions.CryptoJavaSdk}")
dependency("com.squareup.okhttp3:okhttp:${Versions.OKhttp}")
}
}
}
36 changes: 36 additions & 0 deletions src/proxy/buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

plugins {
`kotlin-dsl`
}

repositories {
mavenLocal()
maven(url = "https://mirrors.tencent.com/nexus/repository/maven-public")
mavenCentral()
}
41 changes: 41 additions & 0 deletions src/proxy/buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

object Release {
const val Group = "com.tencent.bk.repo.proxy"
const val Version = "1.0.0"
}

object Versions {
const val DevopsBoot = "0.0.6"
const val BkRepo = "1.1.0-RELEASE"
const val OKhttp = "4.9.0"
const val Polaris = "1.5.2"
const val CommonsText = "1.9"
const val SleuthOtel = "1.0.0-M13"
const val CryptoJavaSdk = "1.1.0"
}
Binary file added src/proxy/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions src/proxy/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 7f4e44c

Please sign in to comment.