Skip to content

Commit

Permalink
Merge branch 'main' of github.com:kosli-dev/cli
Browse files Browse the repository at this point in the history
  • Loading branch information
jumboduck committed Nov 8, 2023
2 parents 238d916 + 3e39440 commit 07ab99a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
15 changes: 7 additions & 8 deletions cmd/kosli/reportArtifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,19 @@ func (o *reportArtifactOptions) run(args []string) error {
return err
}

previousCommit, err := o.latestCommit(currentBranch(gitView))
if err != nil {
return err
}

commitObject, err := gitView.GetCommitInfoFromCommitSHA(o.gitReference)
if err != nil {
return err
}

o.payload.GitCommit = commitObject.Sha1

o.payload.CommitsList, err = gitView.ChangeLog(o.payload.GitCommit, previousCommit, logger)
if err != nil {
previousCommit, err := o.latestCommit(currentBranch(gitView))
if err == nil {
o.payload.CommitsList, err = gitView.ChangeLog(o.payload.GitCommit, previousCommit, logger)
if err != nil && !global.DryRun {
return err
}
} else if !global.DryRun {
return err
}

Expand Down
11 changes: 11 additions & 0 deletions design-docs/azure_env_reporting_algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ The second line informs us that a container started successfully. When we have t
line was the sha256 of this container.


## Findings

A script was periodically executed over a period of time. It involved multiple function apps operating as Docker containers and several servers in the setup:

1. Retention period for the logs are 10 days. One of the function app had a shorter retention period. Don't know why.
2. Deployments and errors (which leads to a restart of the container) generates sha256 events in the log.
3. Scaling events does not end up in the logs.
4. If a function app has had no events for 10 days, it is no longer possible to get the sha256 from the log.
5. When we started to run this script we could get the sha256 from most of the function apps in most of the environments. But not for all.
6. Docker restart with `az functionapp restart` triggers a new pull, restart of the container and it makes an entry in the log.


<!--
Notes:
Expand Down
20 changes: 19 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,28 @@ services:
ports:
- 5001:5000

server:
server-index:
networks: [ cli_net ]
depends_on: [ mongo_rs_initiate, minio ]
image: 772819027869.dkr.ecr.eu-central-1.amazonaws.com/merkely:latest
command: /app/src/documentdb/wait_till_ready_or_raise.py
container_name: cli_kosli_server-index
read_only: true
env_file: [ "./mongo/mongo.env" ]
stop_signal: SIGINT
tmpfs:
- /tmp

server:
networks: [ cli_net ]
depends_on:
mongo_rs_initiate:
condition: service_started
minio:
condition: service_started
server-index:
condition: service_completed_successfully
image: 772819027869.dkr.ecr.eu-central-1.amazonaws.com/merkely:latest
env_file: [ "./mongo/mongo.env" ]
environment:
KOSLI_HOSTNAME: localhost
Expand Down
1 change: 0 additions & 1 deletion minio/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
FROM quay.io/minio/minio:latest
RUN curl https://dl.min.io/client/mc/release/linux-amd64/mc --create-dirs -o /usr/bin/mc
RUN chmod +x /usr/bin/mc

0 comments on commit 07ab99a

Please sign in to comment.