fix: update devops
This commit is contained in:
parent
e84d101055
commit
91fb558cfd
|
@ -1,21 +1,11 @@
|
|||
version: 2
|
||||
name: 阿里云
|
||||
description: ""
|
||||
name: aly
|
||||
description: 阿里云sealos环境
|
||||
global:
|
||||
concurrent: 1
|
||||
param:
|
||||
- ref: ssh_host
|
||||
name: ""
|
||||
value: '"47.92.39.128"'
|
||||
required: false
|
||||
type: STRING
|
||||
hidden: true
|
||||
- ref: ssh_user
|
||||
name: ""
|
||||
value: '"root"'
|
||||
required: false
|
||||
type: STRING
|
||||
hidden: true
|
||||
cache:
|
||||
- GOCACHE
|
||||
- GOMODCACHE
|
||||
workflow:
|
||||
- ref: start
|
||||
name: 开始
|
||||
|
@ -37,6 +27,9 @@ workflow:
|
|||
- start
|
||||
- ref: docker_image_build_0
|
||||
name: docker镜像构建
|
||||
cache:
|
||||
GOCACHE: /root/.cache/go-build
|
||||
GOMODCACHE: /go/pkg/mod
|
||||
task: docker_image_build@1.6.0
|
||||
input:
|
||||
docker_username: ((aly.docker_user))
|
||||
|
@ -45,8 +38,9 @@ workflow:
|
|||
image_tag: '"latest"'
|
||||
registry_address: '"registry.cn-hangzhou.aliyuncs.com"'
|
||||
docker_file: '"Dockerfile"'
|
||||
docker_build_path: git_clone_0.git_path
|
||||
docker_build_path: '"."'
|
||||
workspace: git_clone_0.git_path
|
||||
image_clean: true
|
||||
image_push: true
|
||||
build_args: '""'
|
||||
needs:
|
||||
|
@ -56,10 +50,9 @@ workflow:
|
|||
task: ssh_cmd@1.1.1
|
||||
input:
|
||||
ssh_private_key: ((aly.ssh_private_key))
|
||||
ssh_ip: global.ssh_host
|
||||
ssh_ip: '"47.92.39.128"'
|
||||
ssh_port: '"22"'
|
||||
ssh_user: global.ssh_user
|
||||
ssh_user: '"root"'
|
||||
ssh_cmd: '"kubectl rollout restart deployment pcm-modelarts -n ns-admin"'
|
||||
needs:
|
||||
- docker_image_build_0
|
||||
|
||||
- docker_image_build_0
|
21
Dockerfile
21
Dockerfile
|
@ -1,20 +1,29 @@
|
|||
FROM --platform=$BUILDPLATFORM golang:1.22.4-alpine3.20 AS builder
|
||||
FROM docker-0.unsee.tech/golang:alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
ENV GO111MODULE=on GOPROXY=https://goproxy.cn,direct
|
||||
ENV GOPROXY=https://goproxy.cn \
|
||||
GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
GOCACHE=/root/.cache/go-build \
|
||||
GOMODCACHE=/go/pkg/mod
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
# 使用 GOOS 和 GOARCH 环境变量来构建不同架构的二进制文件
|
||||
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-w -s" -o pcm-modelarts
|
||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
--mount=type=cache,target=/root/.cache/go-build \
|
||||
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-w -s" -o pcm-modelarts
|
||||
|
||||
FROM --platform=$TARGETPLATFORM alpine:latest
|
||||
FROM docker-0.unsee.tech/alpine:latest
|
||||
WORKDIR /app
|
||||
|
||||
#修改alpine源为上海交通大学
|
||||
RUN apk add --no-cache ca-certificates && update-ca-certificates && \
|
||||
apk add --update tzdata && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
|
|
@ -32,7 +32,7 @@ func NewGetTrainingJobLogStreamLogic(ctx context.Context, svcCtx *svc.ServiceCon
|
|||
func (l *GetTrainingJobLogStreamLogic) GetTrainingJobLogStream(in *modelarts.GetTrainingJobLogsPreviewReq, stream modelarts.ModelArtsService_GetTrainingJobLogStreamServer) error {
|
||||
// todo: add your logic here and delete this line
|
||||
var resp modelarts.GetTrainingJobLogsStreamResp
|
||||
|
||||
logx.Errorf("進入查詢日志接口")
|
||||
platform, err := util.GetModelArtsConfWithPlatform(in.Platform)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue