Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
(fix): docker ci
Browse files Browse the repository at this point in the history
  • Loading branch information
adwpc committed Nov 8, 2021
1 parent a18bd28 commit 5ed26f4
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 87 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/docker-app-room.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ jobs:
- uses: actions/checkout@v2

- name: build
run: docker build --tag pionwebrtc/ion:latest-app-room -f docker/app-room.Dockerfile .
run: docker build --no-cache --tag pionwebrtc/ion:latest-app-room -f docker/app-room.Dockerfile .

- name: login
if: github.event_name == 'release'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: tag
Expand All @@ -32,3 +31,8 @@ jobs:
- name: push
if: github.event_name == 'release'
run: docker push pionwebrtc/ion:"$TAG"-app-room
env:
TAG: ${{ github.event.release.tag_name }}

- name: push-master
run: docker push pionwebrtc/ion:latest-app-room
8 changes: 6 additions & 2 deletions .github/workflows/docker-islb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ jobs:
- uses: actions/checkout@v2

- name: build
run: docker build --tag pionwebrtc/ion:latest-islb -f docker/islb.Dockerfile .
run: docker build --no-cache --tag pionwebrtc/ion:latest-islb -f docker/islb.Dockerfile .

- name: login
if: github.event_name == 'release'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: tag
Expand All @@ -32,3 +31,8 @@ jobs:
- name: push
if: github.event_name == 'release'
run: docker push pionwebrtc/ion:"$TAG"-islb
env:
TAG: ${{ github.event.release.tag_name }}

- name: push-master
run: docker push pionwebrtc/ion:latest-islb
8 changes: 6 additions & 2 deletions .github/workflows/docker-sfu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ jobs:
- uses: actions/checkout@v2

- name: build
run: docker build --tag pionwebrtc/ion:latest-sfu -f docker/sfu.Dockerfile .
run: docker build --no-cache --tag pionwebrtc/ion:latest-sfu -f docker/sfu.Dockerfile .

- name: login
if: github.event_name == 'release'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: tag
Expand All @@ -32,3 +31,8 @@ jobs:
- name: push
if: github.event_name == 'release'
run: docker push pionwebrtc/ion:"$TAG"-sfu
env:
TAG: ${{ github.event.release.tag_name }}

- name: push-master
run: docker push pionwebrtc/ion:latest-sfu
8 changes: 6 additions & 2 deletions .github/workflows/docker-signal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ jobs:
- uses: actions/checkout@v2

- name: build
run: docker build --tag pionwebrtc/ion:latest-signal -f docker/signal.Dockerfile .
run: docker build --no-cache --tag pionwebrtc/ion:latest-signal -f docker/signal.Dockerfile .

- name: login
if: github.event_name == 'release'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: tag
Expand All @@ -32,3 +31,8 @@ jobs:
- name: push
if: github.event_name == 'release'
run: docker push pionwebrtc/ion:"$TAG"-signal
env:
TAG: ${{ github.event.release.tag_name }}

- name: push-master
run: docker push pionwebrtc/ion:latest-signal
2 changes: 1 addition & 1 deletion apps/room/server/room_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func (s *RoomService) UpdatePeer(ctx context.Context, in *room.UpdatePeerRequest
}

// check peer exist
log.Infof("sid=%v uid======%v", sid, uid)
log.Infof("sid=%v uid=v", sid, uid)
key = util.GetRedisPeerKey(sid, uid)
if s.redis.HGet(key, "uid") == "" {
return &room.UpdatePeerReply{
Expand Down
2 changes: 1 addition & 1 deletion configs/docker/signal.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ key_type = "HMAC" # this selects the Signing method https://godoc.org/github.co
key = "1q2dGu5pzikcrECJgW3ADfXX3EsmoD99SYvSVCpDsJrAqxou5tUNbHPvkEFI4bTS"

[signal.svc]
services = ["sfu","biz","avp"]
services = ["rtc", "room"]
2 changes: 1 addition & 1 deletion configs/signal.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ key_type = "HMAC"
key = "1q2dGu5pzikcrECJgW3ADfXX3EsmoD99SYvSVCpDsJrAqxou5tUNbHPvkEFI4bTS"

[signal.svc]
services = ["rtc","biz","avp", "room"]
services = ["rtc", "room"]
14 changes: 0 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@ services:
networks:
- ionnet

#avp:
# image: pionwebrtc/ion:latest-avp
# build:
# dockerfile: ./docker/avp.Dockerfile
# context: .
# volumes:
# - "./configs/docker/avp.toml:/configs/avp.toml"
# - "./out:/out/"
# depends_on:
# - nats
# - islb
# networks:
# - ionnet

signal:
image: pionwebrtc/ion:latest-signal
build:
Expand Down
27 changes: 12 additions & 15 deletions docker/app-room.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
FROM golang:1.14.13-stretch
FROM golang:1.16-alpine as builder

ENV GO111MODULE=on
WORKDIR /ion

WORKDIR $GOPATH/src/github.com/pion/ion
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download

COPY go.mod go.sum ./
RUN cd $GOPATH/src/github.com/pion/ion && go mod download
COPY pkg/ pkg/
COPY proto/ proto/
COPY apps/ apps/

COPY pkg/ $GOPATH/src/github.com/pion/ion/pkg
COPY proto/ $GOPATH/src/github.com/pion/ion/proto
COPY apps $GOPATH/src/github.com/pion/ion/apps
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -installsuffix cgo -o /ion/app-room ./apps/room

WORKDIR $GOPATH/src/github.com/pion/ion/apps/room
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /app-room .
FROM alpine

FROM alpine:3.12.1

RUN apk --no-cache add ca-certificates
COPY --from=0 /app-room /usr/local/bin/app-room
COPY --from=builder /ion/app-room /app-room

COPY configs/docker/app-room.toml /configs/app-room.toml

ENTRYPOINT ["/usr/local/bin/app-room"]
ENTRYPOINT ["/app-room"]
CMD ["-c", "/configs/app-room.toml"]
26 changes: 12 additions & 14 deletions docker/islb.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
FROM golang:1.14.13-stretch
FROM golang:1.16-alpine as builder

ENV GO111MODULE=on
WORKDIR /ion

WORKDIR $GOPATH/src/github.com/pion/ion
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download

COPY go.mod go.sum ./
RUN cd $GOPATH/src/github.com/pion/ion && go mod download
COPY pkg/ pkg/
COPY proto/ proto/
COPY cmd/ cmd/

COPY pkg/ $GOPATH/src/github.com/pion/ion/pkg
COPY cmd/ $GOPATH/src/github.com/pion/ion/cmd
COPY proto/ $GOPATH/src/github.com/pion/ion/proto
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o /ion/islb ./cmd/islb

WORKDIR $GOPATH/src/github.com/pion/ion/cmd/islb
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /islb .
FROM alpine

FROM alpine:3.12.1
RUN apk --no-cache add ca-certificates
COPY --from=0 /islb /usr/local/bin/islb
COPY --from=builder /ion/islb /islb

COPY configs/docker/islb.toml /configs/islb.toml

ENTRYPOINT ["/usr/local/bin/islb"]
ENTRYPOINT ["/islb"]
CMD ["-c", "/configs/islb.toml"]
26 changes: 11 additions & 15 deletions docker/sfu.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
FROM golang:1.14.13-stretch
FROM golang:1.16-alpine as builder

ENV GO111MODULE=on
WORKDIR /ion

WORKDIR $GOPATH/src/github.com/pion/ion
COPY go.mod go.mod
COPY go.sum go.sum

COPY go.mod go.sum ./
RUN cd $GOPATH/src/github.com/pion/ion && go mod download
COPY pkg/ pkg/
COPY proto/ proto/
COPY cmd/ cmd/

COPY pkg/ $GOPATH/src/github.com/pion/ion/pkg
COPY cmd/ $GOPATH/src/github.com/pion/ion/cmd
COPY proto/ $GOPATH/src/github.com/pion/ion/proto
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o /ion/sfu ./cmd/sfu

WORKDIR $GOPATH/src/github.com/pion/ion/cmd/sfu
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /sfu .
FROM alpine

FROM alpine:3.12.1

RUN apk --no-cache add ca-certificates
COPY --from=0 /sfu /usr/local/bin/sfu
COPY --from=builder /ion/sfu /sfu

COPY configs/docker/sfu.toml /configs/sfu.toml

ENTRYPOINT ["/usr/local/bin/sfu"]
ENTRYPOINT ["/sfu"]
CMD ["-c", "/configs/sfu.toml"]
27 changes: 12 additions & 15 deletions docker/signal.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
FROM golang:1.14.13-stretch
FROM golang:1.16-alpine as builder

ENV GO111MODULE=on
WORKDIR /ion

WORKDIR $GOPATH/src/github.com/pion/ion
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download

COPY go.mod go.sum ./
RUN cd $GOPATH/src/github.com/pion/ion && go mod download
COPY pkg/ pkg/
COPY proto/ proto/
COPY cmd/ cmd/

COPY pkg/ $GOPATH/src/github.com/pion/ion/pkg
COPY cmd/ $GOPATH/src/github.com/pion/ion/cmd
COPY proto/ $GOPATH/src/github.com/pion/ion/proto
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o /ion/signal ./cmd/signal

WORKDIR $GOPATH/src/github.com/pion/ion/cmd/signal
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /signal .
FROM alpine

FROM alpine:3.12.1

RUN apk --no-cache add ca-certificates
COPY --from=0 /signal /usr/local/bin/signal
COPY --from=builder /ion/signal /signal

COPY configs/docker/signal.toml /configs/signal.toml

ENTRYPOINT ["/usr/local/bin/signal"]
ENTRYPOINT ["/signal"]
CMD ["-c", "/configs/signal.toml"]
2 changes: 1 addition & 1 deletion pkg/node/sfu/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"
"time"

"github.com/apex/log"
"github.com/pion/ion-log"
"github.com/bep/debounce"
ion_sfu_log "github.com/pion/ion-sfu/pkg/logger"
"github.com/pion/ion-sfu/pkg/middlewares/datachannel"
Expand Down
3 changes: 3 additions & 0 deletions pkg/node/signal/signal.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ func NewSignal(conf Config) (*Signal, error) {
}

func (s *Signal) Start() error {
log.Infof("s.Node.Start node=%+v", s.conf.Nats.URL)
err := s.Node.Start(s.conf.Nats.URL)
if err != nil {
log.Errorf("s.Node.Start error err=%+v", err)
s.Close()
return err
}
Expand All @@ -109,6 +111,7 @@ func (s *Signal) Start() error {
}

go func() {
log.Infof("KeepAlive node=%+v", node)
err := s.Node.KeepAlive(node)
if err != nil {
log.Errorf("sig.Node.KeepAlive(%v) error %v", s.Node.NID, err)
Expand Down
4 changes: 2 additions & 2 deletions scripts/service
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SERVICE=$2
show_help()
{
echo ""
echo "Usage: ./service {start|stop} {app-room|signal|islb|sfu|avp}"
echo "Usage: ./service {start|stop} {app-room|signal|islb|sfu}"
echo ""
}

Expand Down Expand Up @@ -93,7 +93,7 @@ if [[ "$ACTION" != "start" && "$ACTION" != "stop" ]]; then
exit 1
fi

if [[ "$SERVICE" != "app-room" && "$SERVICE" != "signal" && "$SERVICE" != "islb" && "$SERVICE" != "sfu" && "$SERVICE" != "avp" ]]; then
if [[ "$SERVICE" != "app-room" && "$SERVICE" != "signal" && "$SERVICE" != "islb" && "$SERVICE" != "sfu" ]]; then
show_help
exit 1
fi
Expand Down

0 comments on commit 5ed26f4

Please sign in to comment.