-
Notifications
You must be signed in to change notification settings - Fork 53
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
On-prem: read blueprints from disk (COMPOSER-2413) #2603
base: main
Are you sure you want to change the base?
Conversation
de7c995
to
dcbf410
Compare
dcbf410
to
091ff7d
Compare
I can't wait to see this in action! I'm trying to get it running locally but can't get anything to appear in Cockpit. I noticed quite a few changes to the makefile... what should I do to get this to run? |
091ff7d
to
12f3c12
Compare
Oh right, so we need to pull in some of the cockpit dependencies. Try |
2e17a88
to
dadbaec
Compare
6983959
to
85f4c58
Compare
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #2603 +/- ##
==========================================
- Coverage 85.23% 84.98% -0.26%
==========================================
Files 175 176 +1
Lines 20253 20318 +65
Branches 1976 1977 +1
==========================================
+ Hits 17263 17267 +4
- Misses 2968 3029 +61
Partials 22 22
Continue to review full report in Codecov by Sentry.
|
c73c587
to
8dd626a
Compare
8dd626a
to
b85d924
Compare
3640100
to
71de59a
Compare
I had to change some typescript config which made this PR a lot bigger. I think if we want to go ahead with this, it would probably be better to split the typescript changes into a separate PR. |
71de59a
to
ad92853
Compare
ad92853
to
c14634f
Compare
c14634f
to
a5c5b94
Compare
a5c5b94
to
0d662ae
Compare
/retest |
The on-prem version of this repo depends on the `Cockpit` project. Some of the files from the `Cockpit` repo are needed to build and run this project. These files are saved into the `pkg/lib` directory, so we need ot add some plumbing for this into the project. We also need to add aliases for `cockpit` and `cockpit/fsinfo` modules. The downside is that we will need to create stub functions and types for the cockpit packages so typescript doesn't complain ¯\_(ツ)_/¯ Additionally, this commit adds some convenience scripts to the Makefile.
We need a toml package to parse the blueprint files, this appears to be the most maintained package.
Add an initial commit to scan a preset directory for user blueprint files. This makes use of the cockpit files api.
0d662ae
to
5cca844
Compare
@@ -1,17 +1,52 @@ | |||
INSTALL_DIR := ~/.local/share/cockpit/image-builder-frontend | |||
|
|||
cockpit/all: devel-uninstall devel-install build | |||
COCKPIT_REPO_URL = https://github.com/cockpit-project/cockpit.git | |||
COCKPIT_REPO_COMMIT = b0e82161b4afcb9f0a6fddd8ff94380e983b2238 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a strategy for keeping this updated but we can figure that out later.
sed -i "s/.*FIRST_BOOT_SERVICE_DATA.*/export const FIRST_BOOT_SERVICE_DATA = '$(FISTBOOT_SERVICE)';/" $@ | ||
|
||
.PHONY: prep | ||
prep: src/constants.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this get used? Can we delete it?
.PHONY: prep | ||
prep: src/constants.ts | ||
|
||
.PHONY: install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete.
install: | ||
npm install | ||
|
||
.PHONY: start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little worried here about co-mingling Cockpit "stuff" with Insights "stuff". Can we move things up one level to avoid this?
@@ -15,6 +15,11 @@ | |||
], | |||
"exactOptionalPropertyTypes": true, | |||
"strictNullChecks": true, | |||
"allowSyntheticDefaultImports": true | |||
"allowSyntheticDefaultImports": true, | |||
"paths": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, we have some co-mingling here. Maybe we can either eliminate this by moving everything up one level as previously suggested, or maybe we can have a base tsconfig.json and then extend it separately for Cockpit and Insights?
@@ -7,6 +7,7 @@ | |||
"npm": ">=7.0.0" | |||
}, | |||
"dependencies": { | |||
"@ltd/j-toml": "1.38.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we actually need this. Sorry for not seeing this before and pointing it out but the Insights service already supports importing on-prem blueprints and I think there's already a "toml" package we can use.
// TODO: maybe we should pull in the cockpit types here | ||
// and keep them in the project. Not ideal because it may | ||
// diverge, so we need to think about it. | ||
export interface UserInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to set up the tslint to enforce this but generally I'm trying to use types and not interfaces.
We can use the cockpit files api to read in blueprints from disk.
This PR adds commits to bring in the required dependencies, some convenience scripts and an initial commit using an RTK query function to read blueprints from file and pull the details into the store.