Skip to content

Commit

Permalink
Merge pull request ao-space#6 from ao-space/dev
Browse files Browse the repository at this point in the history
dev->apply-sdk-go
  • Loading branch information
zhongguang-cn authored Sep 15, 2023
2 parents 304fe31 + 2f8211f commit 387aa2d
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 20 deletions.
92 changes: 87 additions & 5 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022 Institute of Software, Chinese Academy of Sciences (ISCAS)
# Copyright (c) 2022 Institute of Software Chinese Academy of Sciences (ISCAS)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -23,13 +23,20 @@ on:

env:
REGISTRY: ghcr.io
EULIX_REGISTRY: ${{ secrets.EULIX_REGISTRY }}
EULIX_REGISTRY: hub.eulix.xyz
HUAWEICLOUD_REGISTRY_SH: swr.cn-east-3.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_BJ: swr.cn-north-4.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_GZ: swr.cn-south-1.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_HK: swr.ap-southeast-1.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_SG: swr.ap-southeast-3.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_AF: swr.af-south-1.myhuaweicloud.com
HUAWEICLOUD_REGISTRY_LA: swr.la-north-2.myhuaweicloud.com
IMAGE_NAME: ${{ github.repository }}

jobs:

build:
runs-on: [self-hosted, linux, x64]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
Expand All @@ -46,6 +53,9 @@ jobs:
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

- run: echo "GITHUB_REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
shell: bash

- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
Expand All @@ -70,17 +80,88 @@ jobs:
username: ${{ secrets.EULIX_REGISTRY_USERNAME }}
password: ${{ secrets.EULIX_REGISTRY_PASSWORD }}

- name: Log into registry Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_HUB_REGISTRY_PASSWORD }}

- name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_SH }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.HUAWEICLOUD_REGISTRY_SH }}
username: cn-east-3@${{ secrets.HUAWEICLOUD_USERNAME }}
password: ${{ secrets.HUAWEICLOUD_PASSWORD }}

- name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_BJ }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.HUAWEICLOUD_REGISTRY_BJ }}
username: cn-north-4@${{ secrets.HUAWEICLOUD_USERNAME }}
password: ${{ secrets.HUAWEICLOUD_PASSWORD }}

- name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_GZ }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.HUAWEICLOUD_REGISTRY_GZ }}
username: cn-south-1@${{ secrets.HUAWEICLOUD_USERNAME }}
password: ${{ secrets.HUAWEICLOUD_PASSWORD }}

- name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_SG }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.HUAWEICLOUD_REGISTRY_SG }}
username: ap-southeast-3@${{ secrets.HUAWEICLOUD_USERNAME }}
password: ${{ secrets.HUAWEICLOUD_PASSWORD }}

- name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_HK }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.HUAWEICLOUD_REGISTRY_HK }}
username: ap-southeast-1@${{ secrets.HUAWEICLOUD_USERNAME }}
password: ${{ secrets.HUAWEICLOUD_PASSWORD }}

- name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_AF }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.HUAWEICLOUD_REGISTRY_AF }}
username: af-south-1@${{ secrets.HUAWEICLOUD_USERNAME }}
password: ${{ secrets.HUAWEICLOUD_PASSWORD }}

- name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_LA }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.HUAWEICLOUD_REGISTRY_LA }}
username: la-north-2@${{ secrets.HUAWEICLOUD_USERNAME }}
password: ${{ secrets.HUAWEICLOUD_PASSWORD }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v2
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
${{ env.EULIX_REGISTRY }}/${{ env.IMAGE_NAME }}
aospace/${{ env.GITHUB_REPOSITORY_NAME }}
${{ env.HUAWEICLOUD_REGISTRY_SH }}/${{ env.IMAGE_NAME }}
${{ env.HUAWEICLOUD_REGISTRY_BJ }}/${{ env.IMAGE_NAME }}
${{ env.HUAWEICLOUD_REGISTRY_GZ }}/${{ env.IMAGE_NAME }}
${{ env.HUAWEICLOUD_REGISTRY_HK }}/${{ env.IMAGE_NAME }}
${{ env.HUAWEICLOUD_REGISTRY_SG }}/${{ env.IMAGE_NAME }}
${{ env.HUAWEICLOUD_REGISTRY_AF }}/${{ env.IMAGE_NAME }}
${{ env.HUAWEICLOUD_REGISTRY_LA }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4.2.1
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand All @@ -90,4 +171,5 @@ jobs:
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
file: Dockerfile
file: Dockerfile
provenance: false
2 changes: 1 addition & 1 deletion res/aospace-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ version: '2.4'
services:
aospace-upgrade:
container_name: aospace-upgrade
image: hub.eulix.xyz/ao-space/space-upgrade:v1.0.0
image: registry.ao.space/ao-space/space-upgrade:dev
ports:
- "127.0.0.1:5681:5681"
environment:
Expand Down
14 changes: 7 additions & 7 deletions res/docker-compose_run_as_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ version: '2.4'
services:
aospace-postgresql:
container_name: aospace-postgresql
image: hub.eulix.xyz/cicada-private/aospace-postgresql:v1.0.0
image: registry.ao.space/ao-space/space-postgresql:dev
restart: always
healthcheck:
test: pg_isready
Expand Down Expand Up @@ -54,7 +54,7 @@ services:

aospace-filepreview:
container_name: aospace-filepreview
image: hub.eulix.xyz/ao-space/space-filepreview:v1.0.0
image: registry.ao.space/ao-space/space-filepreview:dev
restart: always
depends_on:
aospace-redis:
Expand All @@ -73,7 +73,7 @@ services:

aospace-fileapi:
container_name: aospace-fileapi
image: hub.eulix.xyz/ao-space/space-aofs:v1.0.0
image: registry.ao.space/ao-space/space-aofs:dev
restart: always
depends_on:
aospace-postgresql:
Expand Down Expand Up @@ -112,7 +112,7 @@ services:

aospace-gateway:
container_name: aospace-gateway
image: hub.eulix.xyz/ao-space/space-gateway:v1.0.0
image: registry.ao.space/ao-space/space-gateway:dev
restart: always
ports:
- "127.0.0.1:8080:8080"
Expand Down Expand Up @@ -154,14 +154,14 @@ services:

aonetwork-client:
container_name: aonetwork-client
image: hub.eulix.xyz/ao-space/gt:client-v2.0.4
image: registry.ao.space/ao-space/gt:client-dev
restart: always
volumes:
- /etc/ao-space/gt:/opt/config

aospace-nginx:
container_name: aospace-nginx
image: hub.eulix.xyz/ao-space/space-web:v1.0.0
image: registry.ao.space/ao-space/space-web:dev
restart: always
ports:
- "9980:80"
Expand Down Expand Up @@ -190,7 +190,7 @@ services:

aospace-media-vod:
container_name: aospace-media-vod
image: hub.eulix.xyz/ao-space/space-media-vod:v1.0.0
image: registry.ao.space/ao-space/space-media-vod:dev
restart: always
ports:
- "127.0.0.1:3001:3001"
Expand Down
14 changes: 7 additions & 7 deletions res/docker-compose_run_as_docker_network_mode_host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ version: '2.4'
services:
aospace-postgresql:
container_name: aospace-postgresql
image: hub.eulix.xyz/cicada-private/aospace-postgresql:v1.0.0
image: registry.ao.space/ao-space/space-postgresql:dev
restart: always
healthcheck:
test: pg_isready
Expand Down Expand Up @@ -54,7 +54,7 @@ services:

aospace-filepreview:
container_name: aospace-filepreview
image: hub.eulix.xyz/ao-space/space-filepreview:v1.0.0
image: registry.ao.space/ao-space/space-filepreview:dev
restart: always
depends_on:
aospace-redis:
Expand All @@ -73,7 +73,7 @@ services:

aospace-fileapi:
container_name: aospace-fileapi
image: hub.eulix.xyz/ao-space/space-aofs:v1.0.0
image: registry.ao.space/ao-space/space-aofs:dev
restart: always
depends_on:
aospace-postgresql:
Expand Down Expand Up @@ -109,7 +109,7 @@ services:

aospace-gateway:
container_name: aospace-gateway
image: hub.eulix.xyz/ao-space/space-gateway:v1.0.0
image: registry.ao.space/ao-space/space-gateway:dev
restart: always
ports:
- "127.0.0.1:8080:8080"
Expand Down Expand Up @@ -151,15 +151,15 @@ services:

aonetwork-client:
container_name: aonetwork-client
image: hub.eulix.xyz/ao-space/gt:client-v2.0.4
image: registry.ao.space/ao-space/gt:client-dev
restart: always
network_mode: "host"
volumes:
- /etc/ao-space/gt:/opt/config

aospace-nginx:
container_name: aospace-nginx
image: hub.eulix.xyz/ao-space/space-web:v1.0.0
image: registry.ao.space/ao-space/space-web:dev
restart: always
network_mode: "host"
# 以容器运行时,去掉了 host 网络。如果 nginx 和 network-client 指定 host 网络,那么这2个容器会处于 docker-desktop 的子网中,比如 192.168.65.x 的网络。和宿主机、还有 网关(ao-space) 网络隔离的。不容易相互访问。
Expand All @@ -184,7 +184,7 @@ services:

aospace-media-vod:
container_name: aospace-media-vod
image: hub.eulix.xyz/ao-space/space-media-vod:v1.0.0
image: registry.ao.space/ao-space/space-media-vod:dev
restart: always
ports:
- "127.0.0.1:3001:3001"
Expand Down

0 comments on commit 387aa2d

Please sign in to comment.