Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
586e27e
remove jdk8
Nov 29, 2023
17fc630
remove jdk8 profile
Nov 29, 2023
0126450
remove jdk8
Nov 29, 2023
fd4c043
unit test
Nov 29, 2023
f6cfcf5
unit test
Nov 29, 2023
7247cf9
log back
Nov 29, 2023
e4c0811
add replease
Nov 29, 2023
58e800c
add jdk branch
Nov 29, 2023
0dcd1df
release
Nov 29, 2023
9d63eee
add logback samples
lvjing2 Jan 12, 2024
897f70a
simplify pom lib import
lvjing2 Jan 12, 2024
3156a2e
arklog lazy init
lvjing2 Jan 12, 2024
e611cae
tiny format
lvjing2 Jan 12, 2024
87abcc7
Merge branch 'springboot3-master' into youji-dev-springboot3
lvjing2 Jan 15, 2024
2374f83
modify springboot3
lvjing2 Jan 15, 2024
e496bc6
no log4j2
lvjing2 Jan 16, 2024
1dfce92
add release for snapshot
lvjing2 Jan 16, 2024
6a7dd11
no classload speed up loader
lvjing2 Jan 17, 2024
d828fef
fix samples/service/biz2
yuanyuan2021 Jan 15, 2024
91047ae
Update arch-principle.md
lvjing2 Jan 16, 2024
23a252c
Update arch-principle.md
lvjing2 Jan 16, 2024
cb2d9de
读写隔离
Jan 17, 2024
1a2175f
修改单测,添加ConfirmBatchNum默认值为0的注释,使其为0时也在yaml中展示
liu-657667 Jan 17, 2024
6a2036c
添加单元测试
Jan 17, 2024
d77c650
删除多余的符号
Jan 17, 2024
fc98903
format code
Jan 17, 2024
4190932
ci test fix
liu-657667 Jan 17, 2024
a4005f4
reset class loader after test
Jan 17, 2024
414c4e6
format code
Jan 17, 2024
981624c
添加单测代码
Jan 17, 2024
9b8624c
format code
Jan 17, 2024
9b7da9e
添加单元测试
Jan 17, 2024
40c9be2
format code
Jan 17, 2024
05badfb
format code
Jan 17, 2024
a696abf
补充单元测试
Jan 17, 2024
5a26a1a
stash
yuanyuan2021 Jan 18, 2024
9be8564
1. 模块禁止DubboBootstrapApplicationListener
yuanyuan2021 Jan 19, 2024
137caf5
logback适配文章
yuanyuan2021 Jan 22, 2024
0dc1a2e
dubbo2.7适配文章
yuanyuan2021 Jan 22, 2024
6d4446e
fix dubbo2.6 / dubbo3 sample
yuanyuan2021 Jan 22, 2024
2957871
fix ut
yuanyuan2021 Jan 22, 2024
33e6817
<dev> adapt windows
CodeNoobKing Jan 24, 2024
c163a5c
fix author
CodeNoobKing Jan 26, 2024
780fae4
Update README.md
lylingzhen Jan 26, 2024
a05ce5e
<fix> format
CodeNoobKing Jan 26, 2024
3620e62
fix samples
lvjing2 Jan 26, 2024
f033a7e
add log4j2 adapter
lvjing2 Feb 1, 2024
ea51d50
fix springboot to 3.0.9
lvjing2 Feb 1, 2024
c119d10
add log4j2 adapter to base
lvjing2 Feb 1, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=PAUSE:.spec.pause --no-headers)

if [ "$field_value" == "$desired_field_value" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"pause":false}}' --type=merge
exit 0
Expand Down Expand Up @@ -371,7 +371,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=PAUSE:.spec.pause --no-headers)

if [ "$field_value" == "$desired_field_value" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"pause":false}}' --type=merge
exit 0
Expand Down Expand Up @@ -442,7 +442,7 @@ jobs:
echo "缩容失败"
exit 1
fi

- name: batch scaleup
run: |
kubectl apply -f config/samples/ci/module-deployment_v1alpha1_moduledeployment_batch_provider.yaml
Expand Down Expand Up @@ -514,7 +514,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=PAUSE:.spec.pause --no-headers)

if [ "$field_value" == "$desired_field_value" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"pause":false}}' --type=merge
exit 0
Expand Down Expand Up @@ -699,4 +699,4 @@ jobs:

- name: delete deployment
run: |
kubectl delete -n default deployment dynamic-stock-deployment
kubectl delete -n default deployment dynamic-stock-deployment
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=PAUSE:.spec.pause --no-headers)

if [ "$field_value" == "$desired_field_value" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"pause":false}}' --type=merge
exit 0
Expand Down Expand Up @@ -597,7 +597,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=PAUSE:.spec.pause --no-headers)

if [ "$field_value" == "$desired_field_value" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"pause":false}}' --type=merge
exit 0
Expand Down Expand Up @@ -756,7 +756,7 @@ jobs:
# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=PAUSE:.spec.pause --no-headers)

if [ "$field_value" == "$desired_field_value" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"pause":false}}' --type=merge
exit 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ jobs:
run: |
# 定义要等待的资源名称和字段值
moduledeploymentname=$(kubectl get moduledeployment -o name)
desired_field_value=true

# 定义等待的超时时间(以秒为单位)
timeout_seconds=300
Expand All @@ -183,11 +182,11 @@ jobs:
fi

# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=PAUSE:.spec.pause --no-headers)
field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers)

if [ "$field_value" == "$desired_field_value" ]; then
if [ "$field_value" == "0" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"pause":false}}' --type=merge
kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":1}}' --type=merge
exit 0
else
echo "等待字段值满足条件..."
Expand All @@ -213,7 +212,6 @@ jobs:
run: |
# 定义要等待的资源名称和字段值
moduledeploymentname=$(kubectl get moduledeployment -o name)
desired_field_value=true

# 定义等待的超时时间(以秒为单位)
timeout_seconds=300
Expand All @@ -229,11 +227,11 @@ jobs:
fi

# 使用 kubectl get 命令获取资源对象的详细信息,并提取自定义字段的值
field_value=$(kubectl get $moduledeploymentname -o custom-columns=PAUSE:.spec.pause --no-headers)
field_value=$(kubectl get $moduledeploymentname -o custom-columns=CONFIRMBATCHNUM:.spec.confirmBatchNum --no-headers)

if [ "$field_value" == "$desired_field_value" ]; then
if [ "$field_value" == "1" ]; then
echo "字段值已满足条件,执行分组确认"
kubectl patch $moduledeploymentname -p '{"spec":{"pause":false}}' --type=merge
kubectl patch $moduledeploymentname -p '{"spec":{"confirmBatchNum":2}}' --type=merge
exit 0
else
echo "等待字段值满足条件..."
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/serverless_runtime_snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: SOFA Serverless Runtime Snapshot

## https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
## trigger manually
on:
workflow_dispatch:

jobs:
build_and_test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Docker
uses: docker/metadata-action@v3
with:
images: |
node:14

- name: Test Env prepare
run: |
sudo apt-get update >>/tmp/envprepare.out
sudo apt-get install -y expect >>/tmp/envprepare.out
docker pull mongo:7.0.2-jammy
docker run --name mongodb -d -p 27017:27017 -v /home/runner/work/data:/data/db mongo:7.0.2-jammy
docker pull zookeeper:3.9.0
docker run -p 2181:2181 -it --name zookeeper --restart always -d zookeeper:3.9.0
sudo apt-get install redis-server -y
sudo systemctl start redis-server
sudo cp .github/workflows/ccbin/arkctl /usr/bin/arkctl

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build with Maven
working-directory: sofa-serverless-runtime
run: mvn clean install -DskipTests -B -U -e

- name: get sofa-runtime version & update sofa-runtime version for all test sample app
run: |
serverless_runtime_version=$(find sofa-serverless-runtime/sofa-serverless-common -name "*.jar" |grep -v source |sed "s/.*sofa-serverless-common-\(.*\).jar/\1/")
echo "升级sofa-runtime version to $serverless_runtime_version"
for testsample in `find samples -name "*[3]-samples"`;do sed -i "s/<sofa.serverless.runtime.version>.*<\/sofa.serverless.runtime.version>/<sofa.serverless.runtime.version>$serverless_runtime_version<\/sofa.serverless.runtime.version>/g" $testsample/pom.xml ;done
for testsample in `find samples -name "*[3]-samples"`;do if cat $testsample/pom.xml |grep "<sofa.serverless.runtime.version>"|grep $serverless_runtime_version;then echo "版本校验通过";else echo "版本校验失败";exit 1;fi;done

- name: Run jdk17 serverless runtime test
run: |
set -e
bash .github/workflows/ccbin/start.sh jdk17

snapshot_for_jdk17:
needs: build_and_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Build with Maven
run: mvn --batch-mode deploy -DskipTests -Psnapshot
working-directory: sofa-serverless-runtime
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
![license](https://img.shields.io/badge/license-Apache--2.0-green.svg)
![Maven Central](https://img.shields.io/maven-central/v/com.alipay.sofa.serverless/sofa-serverless-runtime)

完整产品介绍欢迎查阅 [SOFAServerless 官网](https://sofaserverless.gitee.io/home/)
SOFAServerless 品牌全新升级为 Koupleless,欢迎访问全新 GitHub 地址:https://github.com/koupleless/koupleless
完整产品介绍欢迎查阅 [Koupleless 全新官网](https://koupleless.gitee.io/home/)

<br/>

Expand Down
4 changes: 2 additions & 2 deletions arkctl/common/fileutil/file_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package fileutil
import (
"context"
"fmt"
"serverless.alipay.com/sofa-serverless/arkctl/common/osutil"
"strings"
)

Expand All @@ -25,8 +26,7 @@ type FileUrl string

func (url FileUrl) GetFileUrlType() FileUrlType {
switch {
// start with file:// then it's a local file
case strings.HasPrefix(string(url), "file://"):
case strings.HasPrefix(string(url), osutil.GetLocalFileProtocol()):
return FileUrlTypeLocal

default:
Expand Down
32 changes: 32 additions & 0 deletions arkctl/common/osutil/os_util.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Licensed 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 osutil

import (
"runtime"
"strings"
)

func IsWindows() bool {
return strings.HasPrefix(strings.ToLower(runtime.GOOS), "win")
}

func GetLocalFileProtocol() string {
if IsWindows() {
return "file:///"
} else {
return "file://"
}
}
7 changes: 4 additions & 3 deletions arkctl/v1/cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"fmt"
"os"
"path/filepath"
"serverless.alipay.com/sofa-serverless/arkctl/common/osutil"
"strings"

"serverless.alipay.com/sofa-serverless/arkctl/common/cmdutil"
Expand Down Expand Up @@ -146,7 +147,7 @@ func execMavenBuild(ctx *contextutil.Context) bool {

func execParseBizModel(ctx *contextutil.Context) bool {
style.InfoPrefix("Stage").Println("ParseBizModel")
bundlePath := "file://" + defaultArg
bundlePath := osutil.GetLocalFileProtocol() + defaultArg
if doBuild {
searchdir := defaultArg
if subBundlePath != "" {
Expand All @@ -164,7 +165,7 @@ func execParseBizModel(ctx *contextutil.Context) bool {
pterm.Error.Println("can not find pre built biz bundle in build dir!")
return false
}
bundlePath = "file://" + bundlePath
bundlePath = osutil.GetLocalFileProtocol() + bundlePath
}

bizModel, err := ark.ParseBizModel(ctx, fileutil.FileUrl(bundlePath))
Expand Down Expand Up @@ -289,7 +290,7 @@ func execInstallInKubePod(ctx *contextutil.Context) bool {
string(runtime.Must(json.Marshal(ark.BizModel{
BizName: bizModel.BizName,
BizVersion: bizModel.BizVersion,
BizUrl: fileutil.FileUrl("file://" + ctx.Value(ctxKeyArkBizBundlePathInSidePod).(string)),
BizUrl: fileutil.FileUrl(osutil.GetLocalFileProtocol() + ctx.Value(ctxKeyArkBizBundlePathInSidePod).(string)),
}))),
fmt.Sprintf("http://127.0.0.1:%v/installBiz", portFlag),
)
Expand Down
4 changes: 2 additions & 2 deletions arkctl/v1/service/ark/biz_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"archive/zip"
"context"
"fmt"
"serverless.alipay.com/sofa-serverless/arkctl/common/osutil"
"strings"

"serverless.alipay.com/sofa-serverless/arkctl/common/fileutil"
Expand All @@ -37,8 +38,7 @@ func parseJarBizModel(ctx context.Context, bizUrl fileutil.FileUrl) (*BizModel,
return nil, err
}

// remove file:// prefix
zipReader, err := zip.OpenReader(localPath[7:])
zipReader, err := zip.OpenReader(localPath[len(osutil.GetLocalFileProtocol()):])
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion arkctl/v1/service/ark/biz_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"io"
"os"
"path/filepath"
"serverless.alipay.com/sofa-serverless/arkctl/common/osutil"
"strings"
"testing"

Expand Down Expand Up @@ -74,5 +75,5 @@ func TestParseBizModel_LocalJar(t *testing.T) {

assert.Equal(t, model.BizName, "testName")
assert.Equal(t, model.BizVersion, "version")
assert.Equal(t, model.BizUrl, fileutil.FileUrl("file://"+zipFilePath))
assert.Equal(t, model.BizUrl, fileutil.FileUrl(osutil.GetLocalFileProtocol()+zipFilePath))
}
4 changes: 3 additions & 1 deletion arkctl/v1/service/ark/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
"encoding/json"
"net"
"net/http"
"serverless.alipay.com/sofa-serverless/arkctl/common/fileutil"
"serverless.alipay.com/sofa-serverless/arkctl/common/osutil"
"testing"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -123,7 +125,7 @@ func TestInstallBiz_NoServer(t *testing.T) {
BizModel: BizModel{
BizName: "biz",
BizVersion: "0.0.1-SNAPSHOT",
BizUrl: "file:///foobar",
BizUrl: fileutil.FileUrl(osutil.GetLocalFileProtocol() + "/foobar"),
},
TargetContainer: ArkContainerRuntimeInfo{
RunType: ArkContainerRunTypeLocal,
Expand Down
Loading