|
| 1 | +name: scsctl_test |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: [ main ] |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +jobs: |
| 8 | + container-test-job: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v3 |
| 13 | + |
| 14 | + - name: Pull pyroscope/pyroscope:latest image |
| 15 | + run: docker pull pyroscope/pyroscope:latest |
| 16 | + |
| 17 | + - name: Run pyroscope |
| 18 | + run: docker run -d -it -p 4040:4040 pyroscope/pyroscope:latest server |
| 19 | + |
| 20 | + - name: Start a local k8s cluster |
| 21 | + uses: jupyterhub/action-k3s-helm@v3 |
| 22 | + with: |
| 23 | + k3s-channel: latest |
| 24 | + |
| 25 | + - name: Verify function of k8s, kubectl, and helm |
| 26 | + run: | |
| 27 | + echo "kubeconfig: $KUBECONFIG" |
| 28 | + kubectl version |
| 29 | + kubectl get pods --all-namespaces |
| 30 | +
|
| 31 | + helm version |
| 32 | +
|
| 33 | + # helm install falco -f custom-rules.yaml --set "falco.rules_file={/etc/falco/falco_rules.local.yaml,/etc/falco/rules.d}" --set falcoctl.artifact.install.enabled=false --set falcoctl.artifact.follow.enabled=false --set falco.json_output=true --set falco.file_output.enabled=true falcosecurity/falco |
| 34 | + - name: Run falco in k3s |
| 35 | + run: | |
| 36 | + helm repo add falcosecurity https://falcosecurity.github.io/charts |
| 37 | + helm install falco -f custom-rules.yaml --set "falco.rules_file={/etc/falco/falco_rules.local.yaml,/etc/falco/rules.d}" --set falcoctl.artifact.install.enabled=false --set falcoctl.artifact.follow.enabled=false --set falco.json_output=true --set falco.file_output.enabled=true falcosecurity/falco |
| 38 | + sleep 30 |
| 39 | + - name: Run pyroscope in k3s |
| 40 | + run: | |
| 41 | + helm repo add pyroscope-io https://pyroscope-io.github.io/helm-chart |
| 42 | + helm install pyroscope pyroscope-io/pyroscope |
| 43 | + sleep 30 |
| 44 | + - name: List pods |
| 45 | + run: | |
| 46 | + kubectl get pods |
| 47 | + - name: Install a python cli tool from test pypi and run it |
| 48 | + run: | |
| 49 | + python -m pip install --upgrade pip |
| 50 | + python -m pip install --upgrade build |
| 51 | + python -m pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple scsctl |
| 52 | + - name: Run clickhouse |
| 53 | + run: | |
| 54 | + docker run -d --network host --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server |
| 55 | + sleep 5 |
| 56 | + - name: run scsctl |
| 57 | + run: | |
| 58 | + export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=pyroscope,app.kubernetes.io/instance=pyroscope" -o jsonpath="{.items[0].metadata.name}") |
| 59 | + scsctl scan --pyroscope_app_name pyroscope.server --docker_image_name pyroscope/pyroscope:latest --pyroscope_url http://localhost:4040 --falco_pod_name $POD_NAME --falco_target_deployment_name pyroscope --db_enabled --falco_enabled --non_interactive |
0 commit comments