Compare commits

...

6 Commits

Author SHA1 Message Date
eball
1b068798c6 Merge branch 'main' into module-appservice
* main:
  fix: coscmd invalid parameters
  Add VERSION environment variable to workflow
  fix: update error handling to check for both 403 and 404 HTTP status codes in upload scripts
2026-03-03 11:02:18 +08:00
eball
e03eb40ed8 fix: coscmd invalid parameters 2026-03-03 00:44:47 +08:00
eball
79b7d82748 Add VERSION environment variable to workflow 2026-03-02 23:59:23 +08:00
eball
20344416f8 fix: update error handling to check for both 403 and 404 HTTP status codes in upload scripts 2026-03-02 22:33:27 +08:00
dkeven
bf201347c7 chore(appservice): update image version to 0.5.5 2026-03-02 16:40:28 +08:00
dkeven
c050885739 fix(appservice): avoid race condition between upgrade & applyenv (#2593) 2026-03-02 16:40:07 +08:00
5 changed files with 21 additions and 7 deletions

View File

@@ -220,6 +220,7 @@ jobs:
# test
- env:
VERSION: ${{ needs.test-version.outputs.version }}
REPO_PATH: '${{ secrets.REPO_PATH }}'
run: |
export PATH=$PATH:/usr/local/bin:/home/ubuntu/.local/bin
@@ -261,8 +262,8 @@ jobs:
- name: Upload package
run: |
md5sum install-wizard-v${{ needs.test-version.outputs.version }}.tar.gz > install-wizard-v${{ needs.test-version.outputs.version }}.md5sum.txt && \
coscmd upload install-wizard-v${{ needs.test-version.outputs.version }}.md5sum.txt /install-wizard-v${{ needs.test-version.outputs.version }}.md5sum.txt --acl=public-read && \
coscmd upload install-wizard-v${{ needs.test-version.outputs.version }}.tar.gz /install-wizard-v${{ needs.test-version.outputs.version }}.tar.gz --acl=public-read
coscmd upload install-wizard-v${{ needs.test-version.outputs.version }}.md5sum.txt /install-wizard-v${{ needs.test-version.outputs.version }}.md5sum.txt && \
coscmd upload install-wizard-v${{ needs.test-version.outputs.version }}.tar.gz /install-wizard-v${{ needs.test-version.outputs.version }}.tar.gz
install-test:

View File

@@ -31,7 +31,7 @@ while read line; do
curl -fsSLI https://cdn.olares.com/$path$name > /dev/null
if [ $? -ne 0 ]; then
code=$(curl -o /dev/null -fsSLI -w "%{http_code}" https://cdn.olares.com/$path$name)
if [ $code -eq 403 ]; then
if [[ $code -eq 403 || $code -eq 404 ]]; then
bash ${BASE_DIR}/download-deps.sh $PLATFORM $line
if [ $? -ne 0 ]; then

View File

@@ -15,7 +15,7 @@ cat $1|while read image; do
curl -fsSLI https://cdn.olares.com/$path$name.tar.gz > /dev/null
if [ $? -ne 0 ]; then
code=$(curl -o /dev/null -fsSLI -w "%{http_code}" https://cdn.olares.com/$path$name.tar.gz)
if [ $code -eq 403 ]; then
if [[ $code -eq 403 || $code -eq 404 ]]; then
set -ex
skopeo copy --insecure-policy docker://$image oci-archive:$name.tar
gzip $name.tar
@@ -53,7 +53,7 @@ cat $1|while read image; do
curl -fsSLI https://cdn.olares.com/$path$checksum > /dev/null
if [ $? -ne 0 ]; then
code=$(curl -o /dev/null -fsSLI -w "%{http_code}" https://cdn.olares.com/$path$checksum)
if [ $code -eq 403 ]; then
if [[ $code -eq 403 || $code -eq 404 ]]; then
set -ex
skopeo copy --insecure-policy docker://$image oci-archive:$name.tar
gzip $name.tar
@@ -88,7 +88,7 @@ cat $1|while read image; do
curl -fsSLI https://cdn.olares.com/$path$manifest > /dev/null
if [ $? -ne 0 ]; then
code=$(curl -o /dev/null -fsSLI -w "%{http_code}" https://cdn.olares.com/$path$manifest)
if [ $code -eq 403 ]; then
if [[ $code -eq 403 || $code -eq 404 ]]; then
set -ex
BASE_DIR=$(dirname $(realpath -s $0))
python3 $BASE_DIR/get-manifest.py $image -o $manifest

View File

@@ -170,7 +170,7 @@ spec:
priorityClassName: "system-cluster-critical"
containers:
- name: app-service
image: beclab/app-service:0.5.4
image: beclab/app-service:0.5.5
imagePullPolicy: IfNotPresent
ports:
- containerPort: 6755

View File

@@ -342,6 +342,19 @@ func (h *Handler) appUpgrade(req *restful.Request, resp *restful.Response) {
return
}
// hold env batch lease during upgrade kickoff
// to avoid AppEnv controller racing and switching app manager op/state to ApplyEnv in this window
userNamespace := utils.UserspaceName(owner)
releaseLease, err := h.acquireUserEnvBatchLease(req.Request.Context(), userNamespace)
if err != nil {
klog.Errorf("Failed to acquire user env batch lease err=%v", err)
api.HandleError(resp, req, err)
return
}
if releaseLease != nil {
defer releaseLease()
}
err = helper.applyAppEnv(req.Request.Context())
if err != nil {
klog.Errorf("Failed to apply app env err=%v", err)