Skip to content

Commit

Permalink
Update image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
efumagal committed Aug 7, 2023
1 parent 6932954 commit 4f6fea7
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ghcr-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,15 @@ jobs:
args: --file=Dockerfile --severity-threshold=high --sarif-file-output=snyk.sarif
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

- name: Update Deployment Image Tag
working-directory: "kustomize"
run: |
kustomize edit set image geo3d-image=${{ steps.meta.outputs.tags }}
- name: "Push Updated Image Tag"
run: |
git config --global user.name "ci-bot"
git config --global user.email "ci-bot@users.noreply.github.com"
git commit -am "feat: Update deployment image tag to ${{ github.sha }}"
git push
2 changes: 1 addition & 1 deletion k6-load/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const options = {
},
};

const BASE_URL = "http://localhost:8080/distance";
const BASE_URL = "http://localhost:8080/cpu";

export default () => {
check(http.get(BASE_URL), {
Expand Down
2 changes: 1 addition & 1 deletion kustomize/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
spec:
containers:
- name: geo-3d-oteld
image: ghcr.io/efumagal/geo-3d-otel:20230806-1013
image: geo3d-image
imagePullPolicy: IfNotPresent
ports:
- name: http
Expand Down
4 changes: 4 additions & 0 deletions kustomize/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ resources:
- hpa.yaml
- deployment.yaml
- service.yaml
images:
- name: "geo3d-image"
newName: "ghcr.io/efumagal/geo-3d-otel"
newTag: "20230806-1013"
15 changes: 15 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ func main() {
return c.JSON(map[string]any{"distance": distance})
})

app.Get("/cpu", func(c *fiber.Ctx) error {
// Create a child span
_, childSpan := tracer.Start(c.UserContext(), "distance_computation")

for i := 0; i < 1_000_000; i++ {
start := geo.NewCoord3d(randFloat(-90, 90), randFloat(-180, 180), randFloat(0, 10000))
end := geo.NewCoord3d(randFloat(-90, 90), randFloat(-180, 180), randFloat(0, 10000))
geo.Distance3D(start, end)
}

childSpan.End()

return c.SendStatus(http.StatusOK)
})

err = app.Listen("0.0.0.0:8080")
if err != nil {
log.Panic(err)
Expand Down

0 comments on commit 4f6fea7

Please sign in to comment.