diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 0000000..eb636ad --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,46 @@ +name: C/C++ CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + push_to_registry: + name: Push Docker image to GitHub Packages + runs-on: ubuntu-latest + steps: + # required for buildx and multi platform build + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.CR_USERNAME }} + password: ${{ secrets.CR_PAT }} + - uses: actions/checkout@v2 + - name: Set the value + id: version_env + run: | + echo cat {{ $GITHUB_WORKSPACE}}/version.properties >> $GITHUB_ENV + - name: Build container image + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + platforms: linux/amd64,linux/arm64 + tags: | + ${{ secrets.CR_USERNAME }}/nettracer-bpf:latest + ${{ secrets.CR_USERNAME }}/nettracer-bpf:${{ env.version }} + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.gitignore b/.gitignore index 428e38a..9ee0eb2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ build/ *.a *.so *.so.* +.devspace/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f97de73..e5915b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,37 @@ -# NetTracer - ## How to Contribute You are welcome to contribute to NetTracer. Use issues for discussing proposals or to raise a question. If you have improvements to NetTracer, please submit your pull request. For those just getting started, consult this [guide](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). + +## Local deployment environment setup necessary tools +* [Docker - One of containerization engines](https://docs.docker.com/engine/install/) +* [Minikube - local Kubernetes cluster](https://minikube.sigs.k8s.io/docs/start) +* [Kubectl - CLI tool for Kubernetes control](https://docs.docker.com/engine/install/) +* [DevSpace - Deploy & Develop Kubernetes Apps](https://devspace.sh/cli/docs/getting-started/installation/) +### Optional tools +* [Lens IDE - UI for kubectl commands](https://k8slens.dev) + +## Quickstart + +After installation of Docker and Minikube + +``` +minikube start --driver=docker +``` + +Inside repo folder run command and select branch: + +``` +devspace dev +``` +It will take some time, project will be deployed into your local `minikube` cluster, and you will see deployment shell. +It's configured for a file sync between our Pods in k8s and your local project files. + +To remove created resource +``` +devspace purge +``` +To stop, delete minikube cluster +``` +minikube stop +minikube delete +``` \ No newline at end of file diff --git a/README.md b/README.md index 20566cf..c4cd009 100644 --- a/README.md +++ b/README.md @@ -121,8 +121,8 @@ SLAs apply according to the customer's support level. ## Contributing -See CONTRIBUTING.md for details on submitting changes. +See [CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to submit changes and how to prepare [local development environment](./CONTRIBUTING.md#local-deployment-environment-setup-necessary-tools). ## License -NetTracer is under Apache 2.0 license. See LICENSE for details. +NetTracer is under Apache 2.0 license. See LICENSE for details. \ No newline at end of file diff --git a/devspace.yaml b/devspace.yaml new file mode 100644 index 0000000..d1a188e --- /dev/null +++ b/devspace.yaml @@ -0,0 +1,59 @@ +version: v1beta11 + +vars: +- name: IMAGE + value: augustris/nettracer-bpf +- name: BRANCH + default: master + +deployments: +- name: nettracer-bpf + helm: + componentChart: true + + values: + containers: + - image: ${IMAGE} + +dev: + # `dev.sync` configures a file sync between our Pods in k8s and your local project files + sync: + - imageSelector: ${IMAGE} + excludePaths: + - .git/ + - .devspace/ + - .github/ + + terminal: + imageSelector: ${IMAGE} + command: + - /bin/bash + replacePods: + - imageSelector: ${IMAGE} + replaceImage: loftsh/alpine:latest + patches: + - op: replace + path: spec.containers[0].command + value: + - sleep + - op: replace + path: spec.containers[0].args + value: + - "9999999" + - op: remove + path: spec.containers[0].securityContext + +profiles: +- name: production + merge: + images: + app: + image: ${IMAGE} + dockerfile: ./Dockerfile + +dependencies: +- name: clone branch + source: + git: https://github.com/dynatrace-oss/nettracer-bpf + branch: ${BRANCH} + ignoreDependencies: true