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

feat: initial rock implementation #1

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

i-chvets
Copy link
Contributor

@i-chvets i-chvets commented Sep 26, 2023

Description

metacontroller container image should be converted to ROCK.
This PR contains initial ROCK implementation based on best practices.

Summary of changes:

  • Initial ROCK based on the same version of source code as upstream container.

Scan results:

ROCK image metacontroller:2.0.4_22.04_1
CRITICAL: 0 HIGH: 14 MED: 6 LOW: 0

As compared to upstream image metacontroller:2.0.4
CRITICAL: 3 HIGH: 41 MED: 11 LOW: 0

Testing

Manual testing was performed. See the log below.

Manual test log
$ docker run charmedkubeflow/metacontroller:2.0.4_22.04_1 exec pebble start metacontroller
2023-09-26T15:48:59.689Z [pebble] Started daemon.
2023-09-26T15:48:59.710Z [pebble] POST /v1/exec 20.143166ms 202
2023-09-26T15:48:59.727Z [pebble] GET /v1/tasks/1/websocket/control 16.942361ms 200
2023-09-26T15:48:59.727Z [pebble] GET /v1/tasks/1/websocket/stdio 62.045µs 200
2023-09-26T15:48:59.727Z [pebble] GET /v1/tasks/1/websocket/stderr 85.937µs 200
2023-09-26T15:48:59.768Z [pebble] POST /v1/services 27.166079ms 202
2023-09-26T15:48:59.768Z [pebble] Service "metacontroller" starting: metacontroller
2023-09-26T15:48:59.779Z [metacontroller] {"level":"info","ts":1695743339.779103,"msg":"Discovery cache flush interval","discovery_interval":30}
2023-09-26T15:48:59.779Z [metacontroller] {"level":"info","ts":1695743339.7791352,"msg":"API server object cache flush interval","cache_flush_interval":1800}
2023-09-26T15:48:59.779Z [metacontroller] {"level":"info","ts":1695743339.7791398,"msg":"Metrics http server address","port":":9999"}
2023-09-26T15:48:59.779Z [metacontroller] {"level":"info","ts":1695743339.7791443,"msg":"Metacontroller build information","version":"dev"}
2023-09-26T15:48:59.779Z [metacontroller] {"level":"error","ts":1695743339.7792091,"msg":"Terminating","error":"invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable","errorCauses":[{"error":"no configuration has been provided, try setting KUBERNETES_MASTER environment variable"}],"stacktrace":"runtime.main\n\t/snap/go/9362/src/runtime/proc.go:225"}
error: cannot perform the following tasks:
- Start service "metacontroller" (cannot start service: exited quickly with code 1)
2023-09-26T15:48:59.905Z [pebble] GET /v1/changes/1/wait 176.788211ms 200

Summary of changes:
- Initial ROCK based on the same version of source code as upstream container.
@NohaIhab
Copy link
Contributor

Tested and verified rock.
Best practices are followed, and logs are the same as the upstream image.

run ROCK
docker run metacontroller_2.0.4_22.04_1_amd64:rock exec pebble start metacontroller
2023-09-29T07:31:18.837Z [pebble] Started daemon.
2023-09-29T07:31:18.847Z [pebble] POST /v1/exec 8.412198ms 202
2023-09-29T07:31:18.856Z [pebble] GET /v1/tasks/1/websocket/control 7.737935ms 200
2023-09-29T07:31:18.857Z [pebble] GET /v1/tasks/1/websocket/stdio 162.925µs 200
2023-09-29T07:31:18.857Z [pebble] GET /v1/tasks/1/websocket/stderr 62.172µs 200
2023-09-29T07:31:18.867Z [pebble] POST /v1/services 5.143709ms 202
2023-09-29T07:31:18.873Z [pebble] Service "metacontroller" starting: metacontroller
2023-09-29T07:31:18.891Z [metacontroller] {"level":"info","ts":1695972678.8918495,"msg":"Discovery cache flush interval","discovery_interval":30}
2023-09-29T07:31:18.892Z [metacontroller] {"level":"info","ts":1695972678.8918855,"msg":"API server object cache flush interval","cache_flush_interval":1800}
2023-09-29T07:31:18.892Z [metacontroller] {"level":"info","ts":1695972678.8918946,"msg":"Metrics http server address","port":":9999"}
2023-09-29T07:31:18.892Z [metacontroller] {"level":"info","ts":1695972678.8919034,"msg":"Metacontroller build information","version":"dev"}
2023-09-29T07:31:18.892Z [metacontroller] {"level":"error","ts":1695972678.8921132,"msg":"Terminating","error":"invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable","errorCauses":[{"error":"no configuration has been provided, try setting KUBERNETES_MASTER environment variable"}],"stacktrace":"runtime.main\n\t/snap/go/9362/src/runtime/proc.go:225"}
run upstream image
docker run metacontrollerio/metacontroller:v2.0.4
{"level":"info","ts":1695972763.202869,"msg":"Discovery cache flush interval","discovery_interval":30}
{"level":"info","ts":1695972763.202909,"msg":"API server object cache flush interval","cache_flush_interval":1800}
{"level":"info","ts":1695972763.202921,"msg":"Metrics http server address","port":":9999"}
{"level":"info","ts":1695972763.2029326,"msg":"Metacontroller build information","version":"v2.0.4"}
{"level":"error","ts":1695972763.2047753,"msg":"Terminating","error":"invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable","errorCauses":[{"error":"no configuration has been provided, try setting KUBERNETES_MASTER environment variable"}],"stacktrace":"runtime.main\n\t/usr/local/go/src/runtime/proc.go:225"}

Approved

rockcraft.yaml Outdated Show resolved Hide resolved
@i-chvets i-chvets merged commit ad61a07 into main Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants