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

Feature/770 add kic check #8

Merged
merged 28 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d554f60
Updated Main Section and Setup for res-edge labs
renato-marciano Apr 4, 2023
01077d6
Updated PAT instructions
renato-marciano Apr 4, 2023
1a48e8c
Added WebV download instructions.
renato-marciano Apr 4, 2023
a2e6da9
added # to link per PR feedback
renato-marciano Apr 5, 2023
99a608b
Removed instructions for webv download
renato-marciano Apr 5, 2023
12431c1
Remove link to P100k
renato-marciano Apr 5, 2023
ae46ee0
updated app file permission to execute
renato-marciano Apr 5, 2023
ff640ee
Add consistency for lab
renato-marciano Apr 5, 2023
4c9efe4
added
renato-marciano Apr 5, 2023
31affc8
add check for webv
chaosdinosaur Apr 5, 2023
5a1d56b
add prometheus check command
chaosdinosaur Apr 5, 2023
87dff5a
update prometheus check command
chaosdinosaur Apr 5, 2023
d783b21
added
renato-marciano Apr 5, 2023
3283244
added
chaosdinosaur Apr 5, 2023
f868454
Merge branch 'feature/770-add-kic-check' of https://github.com/cse-la…
chaosdinosaur Apr 5, 2023
433e0c8
add grafana check command
chaosdinosaur Apr 5, 2023
40d8a73
add mssql check command
chaosdinosaur Apr 5, 2023
59ba4b6
update readme
chaosdinosaur Apr 5, 2023
a0acd6b
remove test apps
chaosdinosaur Apr 5, 2023
5337c3a
replaced grafana and prometheus with default
renato-marciano Apr 5, 2023
9777bc9
updated sql check command
renato-marciano Apr 5, 2023
79c3a02
Added Fluentbit check command
renato-marciano Apr 5, 2023
3bbf4b6
Merge branch 'main' into feature/770-add-kic-check
renato-marciano Apr 5, 2023
043c36c
fix merge issue
renato-marciano Apr 5, 2023
ee3f673
fix merge issue
renato-marciano Apr 5, 2023
10c3480
updated sql command to remove go
renato-marciano Apr 5, 2023
01438e8
updated comment
renato-marciano Apr 5, 2023
7bb1aa7
Merge branch 'main' into feature/770-add-kic-check
renato-marciano Apr 5, 2023
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
72 changes: 72 additions & 0 deletions apps/tesst/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
dotfiles/placeholder

*.suo
*.user
*.userosscache
*.sln.docstates

.vscode/

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio cache/options directory
.vs/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# Visual Studio code coverage results
*.coverage
*.coveragexml

19 changes: 19 additions & 0 deletions apps/tesst/.kic/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
###
# check commands
###

commands:
- name: check
short: Check local apps
scriptCommands:
- name: tesst
short: Check Tesst
path: check/app

- name: webv
short: Check WebValidate
path: check/webv

- name: flux
short: Check Flux service
path: check/flux
3 changes: 3 additions & 0 deletions apps/tesst/.kic/commands/check/app
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

http localhost:30080/version
3 changes: 3 additions & 0 deletions apps/tesst/.kic/commands/check/flux
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

flux get kustomizations
3 changes: 3 additions & 0 deletions apps/tesst/.kic/commands/check/webv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

kubectl exec -it jumpbox -- http webv.tesst.svc.cluster.local:8080/version
27 changes: 27 additions & 0 deletions apps/tesst/.kic/webv-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
###
# webv config
###

image: k3d-registry.localhost:5500/webv-tesst:local
server: http://localhost:30080
logformat: TsvMin
verbose: false
verboseerrors: false
timeout: 30
region: ""
zone: ""
tag: ""
urlprefix: ""

integration:
files: integration.json
sleep: 0
maxerrors: 10
summary: Tsv

load:
files: load.json
sleep: 10
duration: 30
random: false
port: 8080
34 changes: 34 additions & 0 deletions apps/tesst/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
### Build and Test the App
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build

### copy the source and tests
COPY src /src

WORKDIR /src

# build the app
RUN dotnet publish -c Release -o /app

###########################################################


### Build the runtime container
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS release

### if port is changed, also update value in Config
EXPOSE 8080
WORKDIR /app

### create a user
RUN addgroup -S app && \
adduser -S app -G app && \
mkdir -p /home/app && \
chown -R app:app /home/app

### run as app user
USER app

### copy the app
COPY --from=build /app .

ENTRYPOINT [ "dotnet", "tesst.dll" ]
22 changes: 22 additions & 0 deletions apps/tesst/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dotnet WebAPI Template

![License](https://img.shields.io/badge/license-MIT-green.svg)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)

## Introduction

- todo - add application info here

## Support

This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue.

## Contributing

This project welcomes contributions and suggestions and has adopted the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).

For more information see [Contributing.md](./.github/CONTRIBUTING.md)

## Trademarks

This project may contain trademarks or logos for projects, products, or services. Any use of third-party trademarks or logos are subject to those third-party's policies.
16 changes: 16 additions & 0 deletions apps/tesst/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
app: tesst
containerArgs: []
cpuLimit: 500m
cpuRequest: 300m
environment: dev
image: ghcr.io/cse-labs/tesst:latest
ingressPrefix: /
livenessProbe: /healthz
memoryLimit: 128Mi
memoryRequest: 64Mi
namespace: tesst
nodePort: 30080
port: 8080
readinessProbe: /readyz
targets: []
template: pib-service
72 changes: 72 additions & 0 deletions apps/tesst/ci-cd/codeQL.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '18 16 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
48 changes: 48 additions & 0 deletions apps/tesst/ci-cd/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Docker-Build

on:
workflow_dispatch:
push:
paths:
- 'tesst/Dockerfile'
- 'tesst/**.csproj'
- 'tesst/**.cs'
- '.github/workflows/docker-build.yaml'

jobs:

build:

env:
DOCKER_REPO: ghcr.io/yourOrg/tesst

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Login to Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: "$GITHUB_ACTOR"
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker pull
run: |
docker pull mcr.microsoft.com/dotnet/sdk:6.0
docker pull mcr.microsoft.com/dotnet/aspnet:6.0-alpine

- name: Docker Build
run: |
docker build tesst -t image

- name: Docker Tag and Push
run: |
# VERSION=$(docker run --rm image --version)

# tag the repo with :latest
docker tag image $DOCKER_REPO:latest

# Push to the repo
docker push -a $DOCKER_REPO
Loading