Skip to content

Commit 09ac6b6

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # gradle/libs.versions.toml
2 parents 7aa0ddc + 601bd3f commit 09ac6b6

File tree

8 files changed

+185
-120
lines changed

8 files changed

+185
-120
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,25 +97,13 @@ jobs:
9797

9898
- name: Publish to SimpleCloud Repository
9999
run: |
100-
if [[ "${{ steps.version.outputs.CHANNEL }}" == "release" ]]; then
101-
export GPG_TTY=$(tty)
102-
export GRADLE_OPTS="-Dorg.gradle.daemon=false"
103-
./gradlew --no-daemon --parallel --build-cache publishMavenJavaPublicationToSimplecloudRepository \
104-
-PreleaseType=${{ steps.version.outputs.CHANNEL }} \
105-
-Pversion=${{ steps.version.outputs.VERSION }} \
106-
-Psigning.gnupg.keyName="${{ secrets.GPG_PRIVATE_KEY }}" \
107-
-Psigning.gnupg.passphrase="${{ secrets.GPG_PASSPHRASE }}"
108-
else
109-
./gradlew --parallel --build-cache publishMavenJavaPublicationToSimplecloudRepository \
110-
-PreleaseType=${{ steps.version.outputs.CHANNEL }} \
111-
-Pversion=${{ steps.version.outputs.VERSION }}
112-
fi
100+
./gradlew --parallel --build-cache publishMavenJavaPublicationToSimplecloudRepository \
101+
-PreleaseType=${{ steps.version.outputs.CHANNEL }} \
102+
-Pversion=${{ steps.version.outputs.VERSION }}
113103
env:
114104
COMMIT_HASH: ${{ env.COMMIT_HASH }}
115105
SIMPLECLOUD_USERNAME: ${{ secrets.SIMPLECLOUD_USERNAME }}
116106
SIMPLECLOUD_PASSWORD: ${{ secrets.SIMPLECLOUD_PASSWORD }}
117-
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
118-
ORG_GRADLE_PROJECT_signingPassphrase: ${{ secrets.GPG_PASSPHRASE }}
119107

120108
- name: Prepare Artifacts
121109
run: |
@@ -147,4 +135,4 @@ jobs:
147135
prerelease: ${{ steps.version.outputs.CHANNEL != 'release' }}
148136
files: release-artifacts/*.jar
149137
env:
150-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

controller-runtime/src/main/kotlin/app/simplecloud/controller/runtime/ControllerRuntime.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ class ControllerRuntime(
4343
private val serverRepository = ServerRepository(database, numericalIdRepository)
4444
private val hostRepository = ServerHostRepository()
4545
private val serverHostAttacher = ServerHostAttacher(hostRepository, serverRepository)
46-
private val dropletRepository = DropletRepository(authCallCredentials, serverHostAttacher, controllerStartCommand.envoyStartPort, hostRepository)
46+
private val dropletRepository = DropletRepository(
47+
authCallCredentials,
48+
serverHostAttacher,
49+
controllerStartCommand.grpcHost,
50+
controllerStartCommand.envoyPort,
51+
controllerStartCommand.envoyStartPort,
52+
hostRepository
53+
)
4754
private val pubSubService = PubSubService()
4855
private val controlPlaneServer = ControlPlaneServer(controllerStartCommand, dropletRepository)
4956
private val authServer = OAuthServer(controllerStartCommand, database)

controller-runtime/src/main/kotlin/app/simplecloud/controller/runtime/YamlDirectoryRepository.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ abstract class YamlDirectoryRepository<E, I>(
140140
if (entity != null) {
141141
watcherEvents.onDelete(entity)
142142
}
143-
deleteFile(resolvedPath.toFile())
144143
}
145144
}
146145
}

controller-runtime/src/main/kotlin/app/simplecloud/controller/runtime/droplet/DropletRepository.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ import kotlinx.coroutines.launch
1616
class DropletRepository(
1717
private val authCallCredentials: AuthCallCredentials,
1818
private val serverHostAttacher: ServerHostAttacher,
19+
envoyHost: String,
20+
envoyPort: Int,
1921
private val envoyStartPort: Int,
2022
private val serverHostRepository: ServerHostRepository,
2123
) : Repository<Droplet, String> {
2224

2325
private val currentDroplets = mutableListOf<Droplet>()
24-
private val dropletCache = DropletCache()
26+
private val dropletCache = DropletCache(envoyHost, envoyPort)
2527

2628
override suspend fun getAll(): List<Droplet> {
2729
return currentDroplets

controller-runtime/src/main/kotlin/app/simplecloud/controller/runtime/envoy/DropletCache.kt

Lines changed: 160 additions & 93 deletions
Large diffs are not rendered by default.

controller-runtime/src/main/kotlin/app/simplecloud/controller/runtime/launcher/ControllerStartCommand.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ class ControllerStartCommand(
5353
val envoyStartPort: Int by option(help = "Envoy start port (default: 8080)", envvar = "ENVOY_START_PORT").int()
5454
.default(8080)
5555

56+
val envoyPort: Int by option(help = "Envoy port (default: 8090)", envvar = "ENVOY_PORT").int()
57+
.default(1337)
58+
5659
private val authSecretPath: Path by option(
5760
help = "Path to auth secret file (default: .auth.secret)",
5861
envvar = "AUTH_SECRET_PATH"

controller-runtime/src/main/kotlin/app/simplecloud/controller/runtime/server/ServerRepository.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ class ServerRepository(
2222
) : LoadableRepository<Server, String> {
2323

2424
override suspend fun find(identifier: String): Server? {
25-
return database.context.selectFrom(CLOUD_SERVERS)
25+
return database.context.selectFrom(CLOUD_SERVERS)
2626
.where(CLOUD_SERVERS.UNIQUE_ID.eq(identifier))
2727
.limit(1)
2828
.awaitFirstOrNull()
2929
?.let { record -> mapCloudServersRecordToServer(record) }
3030
}
3131

32-
3332
suspend fun findServerByNumerical(group: String, id: Int): Server? {
3433
return database.context.selectFrom(CLOUD_SERVERS)
3534
.where(
@@ -121,7 +120,6 @@ class ServerRepository(
121120
}
122121
}
123122

124-
@Synchronized
125123
override fun save(element: Server) {
126124
numericalIdRepository.saveNumericalId(element.group, element.numericalId)
127125

controller-runtime/src/main/kotlin/app/simplecloud/controller/runtime/server/ServerService.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class ServerService(
6060
return stopServer(server.toDefinition(), request.stopCause)
6161
} catch (e: Exception) {
6262
throw StatusException(
63-
Status.INTERNAL.withDescription("Error occured whilest cleaning up stopped server: ").withCause(e)
63+
Status.INTERNAL.withDescription("Error occurred whilst cleaning up stopped server: ").withCause(e)
6464
)
6565
}
6666
}
@@ -216,7 +216,9 @@ class ServerService(
216216
startedServers.add(server)
217217
}
218218
} catch (e: Exception) {
219-
throw StatusException(Status.INTERNAL.withDescription("Error whilst starting multiple servers").withCause(e))
219+
throw StatusException(
220+
Status.INTERNAL.withDescription("Error whilst starting multiple servers").withCause(e)
221+
)
220222
}
221223

222224
return StartMultipleServerResponse.newBuilder()
@@ -245,7 +247,6 @@ class ServerService(
245247
val server = buildServer(group, numericalId)
246248
serverRepository.save(server)
247249
val stub = host.stub ?: throw StatusException(Status.INTERNAL.withDescription("Server host has no stub"))
248-
serverRepository.save(server)
249250
try {
250251
val result = stub.startServer(
251252
ServerHostStartServerRequest.newBuilder()
@@ -263,7 +264,7 @@ class ServerService(
263264
}
264265
}
265266

266-
private suspend fun publishServerStartEvents(server: ServerDefinition, startCause: ServerStartCause) {
267+
private fun publishServerStartEvents(server: ServerDefinition, startCause: ServerStartCause) {
267268
pubSubClient.publish(
268269
"event", ServerStartEvent.newBuilder()
269270
.setServer(server)
@@ -380,7 +381,7 @@ class ServerService(
380381

381382
try {
382383
timeout?.let {
383-
group.timeout = GroupTimeout(it);
384+
group.timeout = GroupTimeout(it)
384385
}
385386

386387
groupServers.forEach { server ->

0 commit comments

Comments
 (0)