Skip to content

Commit

Permalink
Merge branch 'main' into csghub__update-new-space
Browse files Browse the repository at this point in the history
  • Loading branch information
朱鑫睿 committed Oct 9, 2024
2 parents 0fc5ef1 + 8d44282 commit 1237f53
Show file tree
Hide file tree
Showing 113 changed files with 936 additions and 806 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
BUILDX_NO_DEFAULT_ATTESTATIONS: 1

steps:
- name: Checkout repository
Expand Down Expand Up @@ -50,3 +52,4 @@ jobs:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
11 changes: 8 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ csghub-build:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
DOCKER_HOST: "tcp://docker:2375"
DOCKER_TLS_CERTDIR: ""
script:
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
before_script:
- apk add --no-cache --virtual .build-deps curl
- mkdir -p ~/.docker/cli-plugins
- curl -SL https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx
- chmod +x ~/.docker/cli-plugins/docker-buildx
- docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
script:
- docker buildx build --platform linux/amd64,linux/arm64 -t ${IMAGE_TAG} --push .

csghub-deploy:
stage: deploy
Expand Down
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
FROM opencsg-registry.cn-beijing.cr.aliyuncs.com/opencsg_public/go-node AS build
FROM --platform=$BUILDPLATFORM opencsg-registry.cn-beijing.cr.aliyuncs.com/opencsg_public/go-node AS builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM

RUN mkdir /myapp
WORKDIR /myapp
ADD . /myapp

ENV CGO_ENABLED=0
RUN go mod tidy
RUN cd frontend && yarn install && yarn build
RUN go build -o csghub-portal ./cmd/csghub-portal
RUN GOOS=$(echo ${TARGETPLATFORM} | cut -f1 -d '/') \
GOARCH=$(echo ${TARGETPLATFORM} | cut -f2 -d '/') \
go build -o csghub-portal ./cmd/csghub-portal

FROM bitnami/minideb:latest
RUN apt update && apt install -y ca-certificates && update-ca-certificates
WORKDIR /myapp
COPY --from=build /myapp/csghub-portal /myapp/csghub-portal
COPY --from=builder /myapp/csghub-portal /myapp/csghub-portal
2 changes: 1 addition & 1 deletion deploy/all_in_one/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* registry

**注意:**
1. CSGHhub v0.4.0支持了应用空间(即space)功能,v0.7.0支持了模型微调、推理等功能。而应用空间,模型微调以及推理等都需要Kubernetes以及其相关Knative组件的配置,基于compose部署不包括Kubernetes平台以及相关依赖Knative组件部署(这部分安装配置详见[Knative安装配置](https://opencsg.com/docs/csghub/101/helm/installation)),如果没有做对接Kubernetes平台,这里部署的CSGHub实例将`不包含应用空间,模型微调和推理`功能。
1. CSGHub v0.4.0支持了应用空间(即space)功能,v0.7.0支持了模型微调、推理等功能。而应用空间,模型微调以及推理等都需要Kubernetes以及其相关Knative组件的配置,基于compose部署不包括Kubernetes平台以及相关依赖Knative组件部署(这部分安装配置详见[Knative安装配置](https://opencsg.com/docs/csghub/101/helm/installation)),如果没有做对接Kubernetes平台,这里部署的CSGHub实例将`不包含应用空间,模型微调和推理`功能。
1. 可以使用CSGHub的[helm chart](https://github.com/OpenCSGs/CSGHub-helm)来安装完整版CSGHub实例,具体安装步骤可参见[CSGHub Helm Chart安装文档](https://opencsg.com/docs/csghub/101/helm/summary)


Expand Down
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ go mod tidy
Air 是一个允许 Go 应用程序实时重载的工具。使用以下命令安装:

```shell
go install github.com/cosmtrek/air@latest
go install github.com/air-verse/air@latest
```

### 获取前端依赖项
Expand Down
2 changes: 1 addition & 1 deletion docs/setup_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ go mod tidy
Air is a tool that allows live reloading of Go applications. Install it using the following command:

```shell
go install github.com/cosmtrek/air@latest
go install github.com/air-verse/air@latest
```

### Getting Frontend Dependencies
Expand Down
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@vitejs/plugin-vue": "^5.1.2",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.41",
"tailwindcss": "^3.4.10",
"vite": "^5.4.0"
"tailwindcss": "^3.4.13",
"vite": "^5.4.6"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:root {
--Base-White: #FFF;
--Base-White: #FFFFFF;

--Gray-25: #FCFCFD;
--Gray-50: #F9FAFB;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/OnPremiseFooter.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="border-t border-[#DCDFE6]">
<div class="border-t border-gray-200">
<div class="max-w-[1280px] m-auto py-4 mb-4 flex justify-between items-center w-full xl:px-5 sm:justify-center sm:gap-4 sm:text-[10px] sm:flex-col">
<p class="text-[#667085] text-base font-light">© 2024 OpenCSG. All rights reserved.</p>
<p class="text-gray-700 text-base font-light">© 2024 OpenCSG. All rights reserved.</p>
<div class="flex items-center gap-6">
<a href="https://twitter.com/OpenCsg" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/application_spaces/AppPayMode.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<span
class="px-[8px] py-[2px] flex items-center justify-center border rounded-md text-[#344054] text-[12px] leading-[18px]"
class="px-[8px] py-[2px] flex items-center justify-center border rounded-md text-gray-700 text-[12px] leading-[18px]"
>{{ thePayMode }}
</span>
</template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="w-full bg-[#FCFCFD] pt-9 pb-[60px] xl:px-10 md:px-0 md:pb-6 md:h-auto">
<div class="w-full bg-gray-25 pt-9 pb-[60px] xl:px-10 md:px-0 md:pb-6 md:h-auto">
<div class="mx-auto max-w-[1280px]">
<repo-header
:private="applicationSpace.private"
Expand Down Expand Up @@ -59,12 +59,12 @@
<p class="font-[600] text-[16px] text-black">{{ $t('application_spaces.errorPage.log') }}</p>
</div>
<div class="flex gap-4 items-center">
<span class="text-[14px] text-[#667085] cursor-pointer"
<span class="text-[14px] text-gray-500 cursor-pointer"
data-value="build"
@click="toggleActiveTab"
:class="isBuildLogTab ? 'active-tab' : ''"
>{{ $t('application_spaces.errorPage.build') }}</span>
<span class="text-[14px] text-[#667085] cursor-pointer"
<span class="text-[14px] text-gray-500 cursor-pointer"
data-value="container"
@click="toggleActiveTab"
:class="isBuildLogTab ? '' : 'active-tab'"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<a
:href="`/spaces/${repo.path}`"
class="xl:w-full focus:outline focus:outline-4 focus:outline-[#EAECF0] hover:shadow-md border border-gray-200 rounded-lg p-4 mlg:!w-full"
class="xl:w-full focus:outline focus:outline-4 focus:outline-gray-200 hover:shadow-md border border-gray-200 rounded-lg p-4 mlg:!w-full"
:style="`width: ${itemWidth};`"
>
<div class="flex justify-between items-center mb-1">
<div class="w-full flex items-center justify-between">
<h3 class="flex-1 text-[#344054] text-md font-normal leading-6 truncate mr-[8px]">
<h3 class="flex-1 text-gray-700 text-md font-normal leading-6 truncate mr-[8px]">
{{ getComputed.path }}
</h3>
<div class="flex gap-2">
<span
v-if="getComputed.visibility"
class="px-[8px] py-[3px] flex items-center justify-center border rounded-md text-[#344054] text-[12px]"
class="px-[8px] py-[3px] flex items-center justify-center border rounded-md text-gray-700 text-[12px]"
>{{ getComputed.visibility }}</span
>
<AppStatus
Expand All @@ -23,7 +23,7 @@
</div>
</div>
</div>
<div class="text-sm leading-snug text-[#667085] flex justify-between">
<div class="text-sm leading-snug text-gray-500 flex justify-between">
<p>
<span class="mr-2">{{ repo.path.split('/')[0] }}</span>
<span class="mr-2">·</span>
Expand Down Expand Up @@ -54,7 +54,7 @@
>
<template #reference>
<p
class="max-w-full h-[36px] text-[#606266] text-sm overflow-hidden text-ellipsis line-clamp-2"
class="max-w-full h-[36px] text-gray-500 text-sm overflow-hidden text-ellipsis line-clamp-2"
>
{{ repo.description }}
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
v-if="deployFailed"
class="flex gap-[8px] mt-[32px] mb-[24px] p-[16px] border border-[#D0D5DD] rounded-[12px] shadow-xs">
class="flex gap-[8px] mt-[32px] mb-[24px] p-[16px] border border-gray-300 rounded-[12px] shadow-xs">
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
Expand All @@ -26,34 +26,34 @@
</defs>
</svg>
<div>
<h3 class="text-[#475467] text-[14px] font-[500]">
<h3 class="text-gray-600 text-[14px] font-[500]">
{{ $t('application_spaces.errorPage.errorAlert') }}
</h3>
<p class="text-[#475467] text-[14px]">
<p class="text-gray-600 text-[14px]">
{{ $t('application_spaces.errorPage.errorAlertDesc') }}
</p>
<p
class="text-[#223B99] font-[400] text-[12px] mt-[12px] cursor-pointer"
class="text-brand-700 font-[400] text-[12px] mt-[12px] cursor-pointer"
@click="showErrorLogs">
{{ $t('application_spaces.errorPage.showErrorLogs') }}
</p>
</div>
</div>

<div
class="border border-[#DCDFE6] rounded-[8px] my-[32px] md:my-0 md:border-none px-[24px] py-[24px]">
class="border border-gray-200 rounded-[8px] my-[32px] md:my-0 md:border-none px-[24px] py-[24px]">
<!-- cloud resource -->
<div class="flex xl:flex-col gap-[32px]">
<div class="w-[380px] sm:w-full flex flex-col">
<div class="text-[14px] text-[#344054] leading-[20px] font-medium">
<div class="text-[14px] text-gray-700 leading-[20px] font-medium">
{{ $t('application_spaces.edit.cloudResource') }}
</div>
<div class="text-[14px] text-[#475467] leading-[20px]">
<div class="text-[14px] text-gray-600 leading-[20px]">
{{ $t('application_spaces.edit.cloudResourceDesc') }}
</div>
</div>
<div class="flex flex-col gap-[6px]">
<p class="text-[#344054] text-[14px]">
<p class="text-gray-700 text-[14px]">
{{ $t('application_spaces.edit.currentCloudResource') }}
</p>
<el-select
Expand All @@ -78,7 +78,7 @@
<!-- 暂停 Space -->
<div class="flex xl:flex-col gap-[32px]">
<div class="w-[380px] sm:w-full flex flex-col">
<div class="text-[14px] text-[#344054] leading-[20px] font-medium">
<div class="text-[14px] text-gray-700 leading-[20px] font-medium">
{{ $t('application_spaces.stopSpace') }}
</div>
</div>
Expand Down Expand Up @@ -106,7 +106,7 @@
<!-- 重启 Space -->
<div class="flex xl:flex-col gap-[32px]">
<div class="w-[380px] sm:w-full flex flex-col">
<div class="text-[14px] text-[#344054] leading-[20px] font-medium">
<div class="text-[14px] text-gray-700 leading-[20px] font-medium">
{{ $t('application_spaces.restartSpace') }}
</div>
</div>
Expand All @@ -125,19 +125,19 @@
<!-- 展示英文名 -->
<div class="flex xl:flex-col gap-[32px]">
<div class="w-[380px] sm:w-full flex flex-col">
<div class="text-[14px] text-[#344054] leading-[20px] font-medium">
<div class="text-[14px] text-gray-700 leading-[20px] font-medium">
{{ $t('application_spaces.name') }}
</div>
<div class="text-[14px] text-[#475467] leading-[20px]">
<div class="text-[14px] text-gray-600 leading-[20px]">
{{ $t('application_spaces.nameTips') }}
</div>
</div>
<div class="flex flex-col gap-[6px]">
<p class="text-[#344054] text-[14px]">
<p class="text-gray-700 text-[14px]">
{{ $t('application_spaces.namespaceName') }}
</p>
<div
class="w-[512px] sm:w-full rounded-[8px] bg-[#F9FAFB] px-[14px] py-[10px] border">
class="w-[512px] sm:w-full rounded-[8px] bg-gray-50 px-[14px] py-[10px] border">
{{ applicationSpacePath }}
</div>
</div>
Expand All @@ -148,10 +148,10 @@
<!-- 更新应用空间别名 -->
<div class="flex xl:flex-col gap-[32px]">
<div class="w-[380px] sm:w-full flex flex-col">
<div class="text-[14px] text-[#344054] leading-[20px] font-medium">
<div class="text-[14px] text-gray-700 leading-[20px] font-medium">
{{ $t('application_spaces.nickname') }}
</div>
<div class="text-[14px] text-[#475467] leading-[20px]">
<div class="text-[14px] text-gray-600 leading-[20px]">
{{ $t('application_spaces.edit.tips') }}
</div>
</div>
Expand All @@ -174,10 +174,10 @@
<!-- 更新应用空间简介 -->
<div class="flex xl:flex-col gap-[32px]">
<div class="w-[380px] sm:w-full flex flex-col">
<div class="text-[14px] text-[#344054] leading-[20px] font-medium">
<div class="text-[14px] text-gray-700 leading-[20px] font-medium">
{{ $t('application_spaces.desc') }}
</div>
<div class="text-[14px] text-[#475467] leading-[20px]">
<div class="text-[14px] text-gray-600 leading-[20px]">
{{ $t('application_spaces.edit.tips2') }}
</div>
</div>
Expand All @@ -201,10 +201,10 @@
<!-- 修改可见性 -->
<div class="flex xl:flex-col gap-[32px]">
<div class="w-[380px] sm:w-full flex flex-col">
<div class="text-[14px] text-[#0a0d12] leading-[20px] font-medium">
<div class="text-[14px] text-gray-700 leading-[20px] font-medium">
{{ $t('application_spaces.edit.changeVisibility') }}
</div>
<div class="text-[14px] text-[#475467] leading-[20px]">
<div class="text-[14px] text-gray-600 leading-[20px]">
{{ $t('application_spaces.edit.statusText') }}
<span class="text-black font-semibold"
>[{{
Expand All @@ -219,7 +219,7 @@
</div>
</div>
<div class="flex flex-col gap-[6px]">
<p class="text-[#344054] text-[14px]">
<p class="text-gray-700 text-[14px]">
{{ $t('application_spaces.edit.visibility') }}
</p>
<el-select
Expand All @@ -242,7 +242,7 @@
<!-- cover image -->
<div class="flex xl:flex-col gap-[32px]">
<div class="w-[380px] sm:w-full flex flex-col">
<div class="text-[14px] text-[#344054] leading-[20px] font-medium">
<div class="text-[14px] text-gray-700 leading-[20px] font-medium">
{{ $t('application_spaces.edit.replaceCoverImage') }}
</div>
</div>
Expand Down Expand Up @@ -286,24 +286,24 @@
<!-- 删除应用空间 -->
<div class="flex xl:flex-col gap-[32px]">
<div class="w-[380px] sm:w-full flex flex-col gap-[6px]">
<div class="text-[14px] text-[#344054] leading-[20px] font-medium">
<div class="text-[14px] text-gray-700 leading-[20px] font-medium">
{{ $t('application_spaces.edit.del') }}
</div>
<div class="text-[14px] text-[#475467] leading-[20px]">
<div class="text-[14px] text-gray-600 leading-[20px]">
{{ $t('application_spaces.edit.delTips') }}
<span class="text-black font-medium">{{ $t('application_spaces.edit.canNot') }}</span>
{{ $t('application_spaces.edit.delTips2') }}
<span class="text-black font-medium break-words">{{ path }}</span>
{{ $t('application_spaces.edit.delTips3') }}
</div>
<div class="text-[14px] text-[#475467] leading-[20px]">
<div class="text-[14px] text-gray-600 leading-[20px]">
{{ $t('application_spaces.edit.enterPls') }}
<span class="text-black font-medium break-words">{{ path }}</span>
{{ $t('application_spaces.edit.sureDel') }}
</div>
</div>
<div class="flex flex-col gap-[8px]">
<p class="text-[#344054] text-[14px]">
<p class="text-gray-700 text-[14px]">
{{ $t('application_spaces.namespaceName') }}
</p>
<el-input
Expand All @@ -315,11 +315,11 @@
<div
id="confirmDelete"
@click="clickDelete"
class="text-[#98A2B3] py-[8px] px-[12px] text-[14px] leading-[20px] rounded-[8px]"
class="text-gray-400 py-[8px] px-[12px] text-[14px] leading-[20px] rounded-[8px]"
:class="
delDesc === applicationSpacePath
? 'bg-[#D92D20] text-[#FFFFFF] cursor-pointer active:shadow-box active:space-y-0 active:space-x-0 active:ring-4 active:ring-red-400 active:ring-opacity-25 active:bg-[#D92D20] hover:text-white'
: 'bg-[#F2F4F7]'
? 'bg-error-600 text-white cursor-pointer active:shadow-box active:space-y-0 active:space-x-0 active:ring-4 active:ring-red-400 active:ring-opacity-25 active:bg-error-600 hover:text-white'
: 'bg-gray-100'
"
@mouseover="handleMouseOver"
@mouseleave="handleMouseLeave">
Expand Down Expand Up @@ -676,14 +676,14 @@
if (this.delDesc !== '') {
document
.getElementById('confirmDelete')
.classList.replace('bg-[#D92D20]', 'bg-[#B42318]')
.classList.replace('bg-error-600', 'bg-error-700')
}
},
handleMouseLeave() {
document
.getElementById('confirmDelete')
.classList.replace('bg-[#B42318]', 'bg-[#D92D20]')
.classList.replace('bg-error-700', 'bg-error-600')
},
showErrorLogs() {
Expand Down
Loading

0 comments on commit 1237f53

Please sign in to comment.