Skip to content

Upgrade to Angular v14 #109

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

Merged

Conversation

LogicalGuy77
Copy link
Contributor

@LogicalGuy77 LogicalGuy77 commented Mar 19, 2025

Upgraded to Angular v13 v14 and fixed other dependencies issues.
Related: #108

Testing:

  • kserve Inferenceservice available in UI

Note: We need to patch all SCSS files in kubeflow repo since while building image we are using components/crud-web-apps/common/frontend.
Currently I am patching it in my Dockerfile

Should I go and create an issue and fix for it in kubeflow repo?

please review @juliusvonkohout , @Griffin-Sullivan

@juliusvonkohout
Copy link
Contributor

/ok-to-test

@juliusvonkohout juliusvonkohout mentioned this pull request Mar 19, 2025
2 tasks
@juliusvonkohout
Copy link
Contributor

Please use a rebase to master, not merge from master

@LogicalGuy77 LogicalGuy77 force-pushed the logicalguy-patch-4-angular13 branch from c2692e7 to 466fbbb Compare March 19, 2025 11:35
@LogicalGuy77
Copy link
Contributor Author

Fixed😊, #108 is already in this PR so we can close that.

Copy link
Contributor

@Griffin-Sullivan Griffin-Sullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just taking a quick look. I'll need some more time to do a real test

* testing cidcd

* fixed lint

Signed-off-by: LogicalGuy77 <[email protected]>
@LogicalGuy77 LogicalGuy77 force-pushed the logicalguy-patch-4-angular13 branch from 1b2a067 to a63c577 Compare March 19, 2025 20:45
Signed-off-by: Harshit Nayan <[email protected]>
Copy link
Contributor

@Griffin-Sullivan Griffin-Sullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes mostly look good. Unsure about tsconfig changes. Need to test locally.

Comment on lines 16 to 28
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"strict": false,
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": false
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
"strictInjectionParameters": true,
"enableIvy": true
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give some explanations for these changes? One that stands out is strict mode. I would prefer to be using that.

Copy link
Contributor Author

@LogicalGuy77 LogicalGuy77 Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Main date-fns API change issue:
    Error: export 'distanceInWords' (imported as 'distanceInWords') was not found in 'date-fns'
  2. TypeScript errors with Node.js type definitions:
    Error: node_modules/@types/node/http.d.ts:230:27 - error TS2362

Changes:

  1. Added "skipLibCheck": true - This will tell TypeScript to skip type checking of declaration files (*.d.ts), which will help with the @types/node errors
  2. "strictInjectionParameters": true Ensures type safety when injecting dependencies
  3. "enableIvy": true - Enables Angular's Ivy rendering and compilation pipeline (default in Angular 13+)

I'll try removing strict mode to see if build is successful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Griffin-Sullivan removing strict mode runs fine locally, I'll update changes in next commit

@Griffin-Sullivan
Copy link
Contributor

Mind updating the README instructions to mention the correct Node version?

Copy link
Contributor

@Griffin-Sullivan Griffin-Sullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to get it running locally. However, you will need to update the README so the start up steps work with your changes.

Dockerfile Outdated

COPY --from=fetch-kubeflow-kubeflow $LIB/ ./
# Patch all SCSS files with tilde imports
RUN find . -name "*.scss" -exec sed -i "s|@use '~@angular/material' as mat;|@use '@angular/material' as mat;|" {} \;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please lets do the upgrade
"testing it now. The whole tilda replacement wouldn't be necessary if we update the COMMIT we are using for the kubeflow common lib. See this commit from a few months ago https://github.com/kubeflow/kubeflow/commit/78969ee8246a6f11295378fc61273b1f2dbe07a8#diff-e97c6691e0d4878d4bc25a491[…]fa508aced14c98ef7b4317910ec7R1"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used this COMMIT 78969ee but it image was failing to build. I suspect it is because I've upgraded to Angular 13 and this commit 78969ee uses more recent Angular version. Can we get a commit which is compatible with angular 13?

Or should we change our approach to this problem?
@juliusvonkohout @Griffin-Sullivan

@juliusvonkohout
Copy link
Contributor

Sorry for only running the workflows now.

@juliusvonkohout
Copy link
Contributor

To me it seems that the image is building. Does it run locally as well? we should get this PR merged as soon as possible and work in follow-up PRs.

@juliusvonkohout
Copy link
Contributor

@tarekabouzeid might help as well with testing

@LogicalGuy77 LogicalGuy77 changed the title Upgrade to Angular v13 Upgrade to Angular v14 Mar 26, 2025
@LogicalGuy77
Copy link
Contributor Author

I've made changes as per our discussion :)
Please review @juliusvonkohout @Griffin-Sullivan

@juliusvonkohout
Copy link
Contributor

I see the frontend tests failing in https://github.com/kserve/models-web-app/actions/runs/14085457407/job/39453075493?pr=109. If you fix that, let me know and i can run the workflows and merge if they are green. Then you can move over all open topics to a follow up PR. In that follow up PR the ci/cd and automatic testing will be quite important as well.

@LogicalGuy77
Copy link
Contributor Author

@juliusvonkohout I've upgraded the frontend tests to follow as per Angular v14, tests are passing. I've checked them on my repo, you can view it here: LogicalGuy77#9

@juliusvonkohout
Copy link
Contributor

/lgtm
/approve

Please move over all open topics to a follow up PR. In that follow up PR the ci/cd and automatic testing will be quite important as well.

@juliusvonkohout juliusvonkohout merged commit 75f904b into kserve:master Mar 26, 2025
8 checks passed
@juliusvonkohout
Copy link
Contributor

and congratulations, this was a significant contribution :-)

@juliusvonkohout
Copy link
Contributor

Ah and you need to migrate from docker.io to ghcr as well in the next PR.

@LogicalGuy77
Copy link
Contributor Author

thank you @juliusvonkohout , happy to have my first PR merged!😊

I'll start with the follow up PRs. I'll create a new slack thread where we can discuss the areas which we'll focus.

  1. Migrating from docker.io to ghcr.io.
  2. Improving CI/CD and automatic testing

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