Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 6 additions & 40 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,10 @@
# Note: You can use any Debian/Ubuntu based image you want.
FROM mcr.microsoft.com/vscode/devcontainers/base:0-bullseye
FROM golang:1.17 AS builder

# [Option] Install zsh
ARG INSTALL_ZSH="true"
# [Option] Upgrade OS packages to their latest versions
ARG UPGRADE_PACKAGES="false"
# [Option] Enable non-root Docker access in container
ARG ENABLE_NONROOT_DOCKER="true"
# [Option] Use the OSS Moby CLI instead of the licensed Docker CLI
ARG USE_MOBY="true"
RUN go install github.com/temporalio/temporal-cli/cmd/temporal@latest

# Enable new "BUILDKIT" mode for Docker CLI
ENV DOCKER_BUILDKIT=1
FROM gcr.io/distroless/base-debian11

# Install needed packages and setup non-root user. Use a separate RUN statement to add your
# own dependencies. A user of "automatic" attempts to reuse an user ID if one already exists.
ARG USERNAME=automatic
ARG USER_UID=1000
ARG USER_GID=$USER_UID
COPY library-scripts/*.sh /tmp/library-scripts/
RUN apt-get update \
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
# Use Docker script from script library to set things up
&& /bin/bash /tmp/library-scripts/docker-debian.sh "${ENABLE_NONROOT_DOCKER}" "/var/run/docker-host.sock" "/var/run/docker.sock" "${USERNAME}"
COPY --from=builder /go/bin/temporal /

# Install go layer
ENV GOPATH=/go
ENV GO111MODULE=auto

RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"

RUN /bin/bash /tmp/library-scripts/go-debian.sh "latest" "/usr/local/go" "${GOPATH}" "${USERNAME}" "true"

RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/

# Setting the ENTRYPOINT to docker-init.sh will configure non-root access
# to the Docker socket. The script will also execute CMD as needed.
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
EXPOSE 7233
ENTRYPOINT ["/temporal", "server", "start-dev", "--ephemeral", "-n", "default", "--ip" , "0.0.0.0"]
10 changes: 0 additions & 10 deletions .devcontainer/Dockerfile.temporalite

This file was deleted.

4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.5/containers/docker-from-docker-compose
{
"name": "Hello tctl",
"name": "Hello Temporal",
"dockerComposeFile": "docker-compose.yml",
"service": "tctl",
"service": "temporal",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
// Use this environment variable if you need to bind mount your local source code into a new container.
Expand Down
41 changes: 3 additions & 38 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,12 @@
version: '3'

services:
tctl:
container_name: tctl
temporal:
build:
context: .
dockerfile: Dockerfile
args:
INSTALL_ZSH: "false"
UPGRADE_PACKAGES: "true"
image: tctl:test

volumes:
# Forwards the local Docker socket to the container.
- /var/run/docker.sock:/var/run/docker-host.sock
# Update this to wherever you want VS Code to mount the folder of your project
- ..:/workspace:cached

# Overrides default command so things don't shut down after the process ends.
entrypoint: /usr/local/share/docker-init.sh
command: sleep infinity
# Uncomment the next four lines if you will use a ptrace-based debuggers like C++, Go, and Rust.
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined

# Uncomment the next line to use a non-root user for all processes.
# user: vscode

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:temporalite
depends_on:
- temporalite

temporalite:
build:
context: .
dockerfile: Dockerfile.temporalite
image: temporalite:test
container_name: temporalite
image: temporal:test
container_name: temporal
ports:
- 7233:7233
restart: always
25 changes: 0 additions & 25 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

18 changes: 0 additions & 18 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

73 changes: 42 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,68 @@
name: Go
name: CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
copyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
go-version-file: "go.mod"
check-latest: true

- name: Verify File Headers
run: go run ./internal/copyright --verify-only
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
check-latest: true
- name: Race
run: go test -v -race ./...
continue-on-error: true
- name: Test
run: go test -v -coverpkg=./... -covermode=atomic -coverprofile=coverage.out ./...
- name: Coverage
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
build:
run: go run ./cmd/copyright --verify-only

# coverage: // TODO uncomment once repo is public as codecov token won't be required
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# - name: Set up Go
# uses: actions/setup-go@v3
# with:
# go-version-file: "go.mod"
# check-latest: true

# - name: Race
# run: go test -v -race ./...
# continue-on-error: true

# - name: Test
# run: go test -v -coverpkg=./... -covermode=atomic -coverprofile=coverage.out ./...

# - name: Coverage
# uses: codecov/codecov-action@v3

test:
strategy:
fail-fast: true
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04]
os: [ubuntu-latest, macos-latest, windows-latest]
flags:
- ""
- -tags headless
cgo: ["0", "1"]
- ""
- -tags headless
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}, os: ${{ matrix.os }}"

- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v3.0.0
with:
go-version-file: 'go.mod'
go-version-file: "go.mod"
check-latest: true

- name: Test
env:
CGO_ENABLED: ${{ matrix.cgo }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
id: meta
uses: docker/metadata-action@v3
with:
images: temporaliotest/tctl
images: temporaliotest/temporal
tags: |
type=sha,format=short,event=branch
type=semver,pattern={{version}}
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/release.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/test.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/trigger-publish.yml

This file was deleted.

Loading