Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vines26 committed Mar 2, 2024
0 parents commit fbfeb3e
Show file tree
Hide file tree
Showing 952 changed files with 175,743 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .blackrc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[tool.black]
line-length = 88
target-version = ['py38']
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
| foo.py # also separately exclude a file named foo.py in
# the root of the project
)
'''
37 changes: 37 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# Pytest Coverage Configuration File
#

[run]
branch = True
omit =
# Test Files
*/tests/*
*__init__.py
# Rest API (FastAPI)
rib/restapi/*
rib/scripts/local*
rib/scripts/misc*
rib/scripts/remote*

[report]
fail_under = 50
ignore_errors = True
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

[html]
directory = reports/test_coverage_report
44 changes: 44 additions & 0 deletions .coveragerc-scripts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
# Pytest Coverage Configuration File
#

[run]
branch = True
omit =
# Test Files
*/tests/*
*__init__.py
rib/artifacts/*
rib/aws_env/*
rib/bin/*
rib/cli/*
rib/commands/*
rib/config/*
rib/deployment/*
rib/state/*
rib/network_manager/*
rib/topology/*
rib/utils/*
rib/scripts/internal/*

[report]
fail_under = 20
ignore_errors = True
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

[html]
directory = reports/test_scripts_coverage_report
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.*
.*/
!.blackrc.toml
!.coveragerc
!.coveragerc-scripts
!.pylintrc
**/.gitignore
*.egg-info/
README.md
test_coverage_report/
test_report/
race_in_the_box.egg-info/
docker-image/
!docker-image/docker_environment/
entrypoints/
sandbox/
reports/
webapp/
48 changes: 48 additions & 0 deletions .github/labeler_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: 1
labels:
# Size labels
- label: "size: xsmall"
size:
below: 10
exclude-files:
- "package-lock.json"
- label: "size: small"
size:
above: 9
below: 100
exclude-files:
- "package-lock.json"
- label: "size: medium"
size:
above: 99
below: 500
exclude-files:
- "package-lock.json"
- label: "size: large"
size:
above: 499
below: 1000
exclude-files:
- "package-lock.json"
- label: "size: xlarge"
size:
above: 999
exclude-files:
- "package-lock.json"
# Content/module labels
- label: "module: ci"
files:
- ".github/.*"
- label: "module: documentation"
files:
- "documentation/.*"
- "README.md"
- label: "module: rib"
files:
- "docker-image/.*"
- "entrypoints/.*"
- "rib/.*"
- "scripts/.*"
- label: "module: webapp"
files:
- "webapp/.*"
89 changes: 89 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build Docker Image

on:
workflow_call:
inputs:
context:
type: string
dockerfile:
default: Dockerfile
type: string
image-name:
type: string
registry:
default: ghcr.io
type: string
platforms:
default: linux/amd64,linux/arm64
type: string
outputs:
image-name:
description: "Built image name"
value: ${{ jobs.build-image.outputs.image-name }}
metadata:
description: "Built image metadata"
value: ${{ jobs.build-image.outputs.metadata }}

jobs:
build-image:
runs-on: ubuntu-latest
outputs:
image-name: ${{ steps.image-name.outputs.image-name }}
metadata: ${{ steps.build.outputs.metadata }}
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
uses: actions/checkout@v3

- name: Log in to Container Registry
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'

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

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ inputs.registry }}/${{ github.repository }}/${{ inputs.image-name }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
- name: Configure Docker Caching
id: cache
uses: int128/docker-build-cache-config-action@v1
with:
image: ${{ inputs.registry }}/${{ github.repository }}/${{ inputs.image-name }}/cache

- name: Build and Push Docker Image
id: build
uses: docker/build-push-action@v4
with:
context: ${{ inputs.context }}
file: ${{ inputs.dockerfile }}
platforms: ${{ inputs.platforms }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: ${{ steps.cache.outputs.cache-from }}
cache-to: ${{ steps.cache.outputs.cache-to }}

- id: image-name
run: echo "image-name=${{ fromJSON(steps.build.outputs.metadata)['image.name'] }}" >> $GITHUB_OUTPUT
Loading

0 comments on commit fbfeb3e

Please sign in to comment.