Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cheetah main #1

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/go/.devcontainer/base.Dockerfile

# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster
FROM mcr.microsoft.com/devcontainers/go:1-1.21-bullseye

ENV DOCKER_BUILDKIT=1
ENV DOCKER_DEFAULT_PLATFORM=linux/amd64

# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends git curl graphviz

USER vscode

# Install github act
RUN curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
56 changes: 56 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// 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.238.0/containers/go
{
"name": "Go",
"build": {
"dockerfile": "Dockerfile",
"args": {
}
},
"containerEnv": {
"GITHUB_ACTOR": "${localEnv:GITHUB_ACTOR}",
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}"
},
// "runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
"runArgs": [
//"--cap-add=SYS_PTRACE",
//"--security-opt",
//"seccomp=unconfined",
"--network=host",
//"--network=cheetah-infrastructure"
"--privileged"
],
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"golang.Go",
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml",
"IronGeek.vscode-env",
"github.vscode-github-actions",
"jebbs.plantuml",
"GitHub.copilot",
"github.vscode-github-actions"
]
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
1854
],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "go version",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
71 changes: 71 additions & 0 deletions .github/workflows/rc-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: "Publish Manual Release"
on:
workflow_dispatch:
push:
branches:
- cheetah-main

env:
IMAGE_NAME: ${{ github.repository }}

permissions:
contents: read
packages: write

jobs:
release:
runs-on: ubuntu-latest
name: Release release-candiate
steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.work'
cache: false

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@879dcbb708d40f8b8679d4f7941b938a086e23a7
with:
images: ghcr.io/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.vendor=Trifork
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch,suffix=-${{ github.run_id }}
type=ref,event=pr
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: build
working-directory: opensearch-operator/
run: make build

- name: Docker login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5
with:
file: opensearch-operator/Dockerfile
context: opensearch-operator/
push: true
outputs: type=registry
builder: ${{ steps.buildx.outputs.name }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
Loading