Skip to content

Commit 42c467c

Browse files
Merge branch 'konveyor:main' into main
2 parents 591ff00 + 161fba8 commit 42c467c

File tree

65 files changed

+970
-444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+970
-444
lines changed

.github/workflows/image-build.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
image_name: "tackle2-ui"
2222
containerfile: "./Dockerfile"
2323
architectures: '[ "amd64", "arm64", "ppc64le", "s390x" ]'
24+
extra-args: "--ulimit nofile=4096:4096"
2425
secrets:
2526
registry_username: ${{ secrets.QUAY_PUBLISH_ROBOT }}
2627
registry_password: ${{ secrets.QUAY_PUBLISH_TOKEN }}

.github/workflows/pr-closed.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ jobs:
1313
pull-requests: write
1414
contents: write
1515
if: github.event.pull_request.merged == true
16+
secrets: inherit
1617
uses: konveyor/release-tools/.github/workflows/cherry-pick.yml@main

BRANDING.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# Branding
2+
3+
The UI supports static branding at build time. Dynamically switching brands is not
4+
possible with the current implementation.
5+
6+
## Summary
7+
8+
Each of the project modules need to do some branding enablement.
9+
10+
- `@konveyor-ui/common` pulls in the branding assets and packages the configuration,
11+
strings and assets within the common package. The other modules pull branding
12+
from the common module.
13+
14+
- `@konveyor-ui/client` uses branding from the common package:
15+
16+
- The location of `favicon.ico`, `manifest.json` and any other branding
17+
assets that may be referenced in the `brandingStrings` are sourced from the
18+
common package.
19+
20+
- The `brandingStrings` are used by the dev-server runtime, to fill out the
21+
`index.html` template.
22+
23+
- The about modal and application masthead components use the branding strings
24+
provided by the common module to display brand appropriate logos, titles and
25+
about information. Since the common module provides all the information, it
26+
is packaged directly into the app at build time.
27+
28+
- `@konveyor-ui/server` uses the `brandingStrings` from the common package to fill
29+
out the `index.html` template.
30+
31+
## Providing alternate branding
32+
33+
To provide an alternate branding to the build, specify the path to the branding assets
34+
with the `BRANDING` environment variable. Relative paths in `BRANDING` are computed
35+
from the project source root.
36+
37+
Each brand requires the presence of at least the following files:
38+
39+
- `strings.json`
40+
- `favicon.ico`
41+
- `manifest.json`
42+
43+
With a file path of `/alt/custom-branding`, a build that uses an alternate branding
44+
is run as:
45+
46+
```sh
47+
> BRANDING=/alt/custom-branding npm run build
48+
```
49+
50+
The dev server can also be run this way. Since file watching of the branding assets
51+
is not implemented in the common module's build watch mode, it may be necessary to
52+
manually build the common module before running the dev server. When working on a
53+
brand, it is useful to run the dev server like this:
54+
55+
```sh
56+
> export BRANDING=/alt/custom-branding
57+
> npm run build -w common
58+
> npm run start:dev
59+
> unset BRANDING # when you don't want to use the custom branding path anymore
60+
```
61+
62+
### File details
63+
64+
#### strings.json
65+
66+
The expected shape of `strings.json` is defined in [branding.ts](./common/src/branding.ts).
67+
68+
The default version of the file is [branding/strings.json](./branding/strings.json).
69+
70+
A minimal viable example of the file is:
71+
72+
```json
73+
{
74+
"application": {
75+
"title": "Konveyor"
76+
},
77+
"about": {
78+
"displayName": "Konveyor"
79+
},
80+
"masthead": {}
81+
}
82+
```
83+
84+
At build time, the json file is processed as an [ejs](https://ejs.co/) template. The
85+
variable `brandingRoot` is provided as the relative root of the branding
86+
assets within the build of the common module. Consider the location of `strings.json`
87+
in your branding directory as the base `brandingRoot` when creating a new brand.
88+
89+
For example, to properly reference a logo within this branding structure:
90+
91+
```
92+
special-brand/
93+
images/
94+
masthead-logo.svg
95+
about-logo.svg
96+
strings.json
97+
```
98+
99+
Use a url string like this:
100+
101+
```json
102+
{
103+
"about": {
104+
"imageSrc": "<%= brandingRoot %>/images/about-logo.svg"
105+
}
106+
}
107+
```
108+
109+
and in the output of `BRANDING=special-brand npm run build -w common`, the `imageSrc`
110+
will be `branding/images/about-logo.svg` with all of the files in `special-branding/*`
111+
copied to and available to the client and server modules from
112+
`@konveyor-ui/common/branding/*`.
113+
114+
#### favicon.ico
115+
116+
A standard favorite icon file `favicon.ico` is required to be in the same directory
117+
as `strings.json`
118+
119+
#### manifest.json
120+
121+
A standard [web app manifest](https://developer.mozilla.org/en-US/docs/Web/Manifest)
122+
file `manifest.json` is required to be in the same directory as `strings.json`.
123+
124+
## Technical details
125+
126+
All branding strings and assets are pulled in to the common module. The client and
127+
server modules access the branding from the common module build.
128+
129+
The `common` module relies on rollup packaging to embed all of the brand for easy
130+
use. The use of branding strings in `client` and `server` modules is straight forward.
131+
Pulling in `strings.json` and providing the base path to the brand assets is a
132+
more complicated.
133+
134+
The `common` module provides the `brandingAssetPath()` function to let the build time
135+
code find the root path to all brand assets. Webpack configuration files use this
136+
function to source the favicon.ico, manifest.json and other brand assets to be copied
137+
to the application bundle.
138+
139+
The `brandingStrings` is typed and sourced from a json file. To pass typescript builds,
140+
a stub json file needs to be available at transpile time. By using a typescript paths
141+
of `@branding/strings.json`, the stub json is found at transpile time. The generated
142+
javascript will still import the path alias. The
143+
[virtual rollup plugin](https://github.com/rollup/plugins/tree/master/packages/virtual)
144+
further transform the javascript output by replacing the `@branding/strings.json` import
145+
with a dynamically built module containing the contents of the brand's `strings.json`.
146+
The brand json becomes a virtual module embedded in the common module.
147+
148+
A build for a custom brand will fail (1) if the expected files cannot be read, or (2)
149+
if `strings.json` is not a valid JSON file. **Note:** The context of `stings.json` is
150+
not currently validated. If something is missing or a url is malformed, it will only
151+
be visible as a runtime error.

INTERNATIONALIZATION.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ locales: ["en", "es", "myLanguageCode"]
2525
npm extract
2626
```
2727

28-
The previous command created a file `public/locales/{myLanguageCode}/translation.json`; the content of this file should be the translated new language. As a reference you can use the english version of the translation located at [public/locales/en/translation.json](https://github.com/konveyor/tackle-ui/blob/main/public/locales/en/translation.json)
28+
The previous command created a file `public/locales/{myLanguageCode}/translation.json`; the content of this file should be the translated new language. As a reference you can use the english version of the translation located at [public/locales/en/translation.json](https://github.com/konveyor/tackle2-ui/blob/main/client/public/locales/en/translation.json)
2929

3030
> As soon as you feel confident, open a new Pull Request with your changes and make it part of the official repository.
3131
3232
## How to see the new translation in action?
3333

34-
To see your changes in action you will need to start Tackle UI in development mode. For starting Tackle UI in development mode follow the instruction at [Starting the UI](https://github.com/konveyor/tackle-ui#starting-the-ui)
34+
To see your changes in action you will need to start Tackle UI in development mode. For starting Tackle UI in development mode follow the instruction at [Development section](https://github.com/konveyor/tackle2-ui/blob/main/README.md#development)
3535

3636
Steps:
3737

38-
- Start Tackle UI in dev mode following [Starting the UI](https://github.com/konveyor/tackle-ui#starting-the-ui) instructions.
38+
- Start Tackle UI in dev mode following the instructions in the [Development section](https://github.com/konveyor/tackle2-ui/blob/main/README.md#development).
3939
- Go to Keycloak http://localhost:8180/auth/admin/ and use `username=admin, password=admin`. Go to `Realm settings > themes > Supported locales` and select the new language you are adding. Finally click on `Save`.
4040
- Go to http://localhost:3000/ and you should be redirected to the Login page where you are able to select your new language.
4141

@@ -45,4 +45,4 @@ At this point you should be able to see your new language already translated int
4545
4646
## Why the questionnaire (assessment process) is not translated?
4747

48-
The questionnaire is data comming from https://github.com/konveyor/tackle-pathfinder hence the translation to a new language of the questionnaire should be done in that repository.
48+
To accommodate diverse user needs, including internationalization, our custom assessment module supports the uploading of YAML files. This flexibility allows for the easy adaptation of assessments to different languages or specific requirements. If you're looking to offer assessments in a new language, simply create and upload a YAML file tailored to that language.

README.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,25 @@ $ minikube config set memory 10240
4949
$ minikube config set cpus 4
5050
```
5151

52-
From a terminal with administrator access (but not logged in as root), run:
52+
Note: Depending on your driver, administrator access may be required. Common choices include Docker for container-based virtualization and KVM for hardware-assisted virtualization on Linux systems. If you're not sure which driver is best for you or if you're encountering compatibility issues, Minikube also supports auto-selecting a driver based on your system's capabilities and installed software.
53+
54+
From a terminal run:
55+
56+
```sh
57+
$ minikube start --addons=dashboard --addons=ingress
58+
```
59+
60+
Note: We need to enable the dashboard and ingress addons. The dashboard addon installs the dashboard service that exposes the Kubernetes objects in a user interface. The ingress addon allows us to create Ingress CRs to expose the Tackle UI and Tackle Hub API.
61+
62+
Since the olm addon is disabled until OLM issue [2534](https://github.com/operator-framework/operator-lifecycle-manager/issues/2534) is resolved we need to install the [OLM manually](https://github.com/operator-framework/operator-lifecycle-manager/releases) i.e. for version `v0.27.0` we can use:
5363

5464
```sh
55-
$ minikube start --addons=dashboard --addons=ingress --addons=olm
65+
curl -L https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.27.0/install.sh -o install.sh
66+
chmod +x install.sh
67+
./install.sh v0.27.0
5668
```
5769

58-
Note: We need to enable the dashboard, ingress and olm addons. The dashboard addon installs the dashboard service that exposes the Kubernetes objects in a user interface. The ingress addon allows us to create Ingress CRs to expose the Tackle UI and Tackle Hub API. The olm addon allows us to use an operator to deploy Tackle.
70+
See also official Konveyor instructions for [Provisioning Minikube](https://konveyor.github.io/konveyor/installation/#provisioning-minikube).
5971

6072
### Configuring kubectl for minikube
6173

@@ -83,7 +95,9 @@ You will need `kubectl` on your PATH and configured to control minikube in order
8395
8496
### Installing the Konveyor operator
8597
86-
The [konveyor/operator git repository](https://github.com/konveyor/operator) provides a script to install Tackle locally using `kubectl`. You can [inspect its source here](https://github.com/konveyor/operator/blob/main/hack/install-tackle.sh). This script creates the `konveyor-tackle` namespace, CatalogSource, OperatorGroup, Subscription and Tackle CR, then waits for deployments to be ready.
98+
Follow the official instructions for [Installing Konveyor Operator](https://konveyor.github.io/konveyor/installation/#installing-konveyor-operator)
99+
100+
Alternatively, the [konveyor/operator git repository](https://github.com/konveyor/operator) provides a script to install Tackle locally using `kubectl`. You can [inspect its source here](https://github.com/konveyor/operator/blob/main/hack/install-tackle.sh). This script creates the `konveyor-tackle` namespace, CatalogSource, OperatorGroup, Subscription and Tackle CR, then waits for deployments to be ready.
87101
88102
#### Customizing the install script (optional)
89103
@@ -126,7 +140,7 @@ $ npm run start:dev
126140
127141
## Understanding the local development environment
128142
129-
Tackle2 runs in a Kubernetes compatible environment (Openshift, Kubernetes or minikube) and is usually deployed with Tackle2 Operator (OLM).
143+
Tackle2 runs in a Kubernetes compatible environment (i.e. Openshift, Kubernetes or minikube) and is usually deployed with Tackle2 Operator (OLM).
130144
Although the UI pod has access to tackle2 APIs from within the cluster, the UI can also be executed outside the cluster and access Tackle APIs endpoints by proxy.
131145
132146
The React and Patternfly based UI is composed of web pages served by an http server with proxy capabilities.
@@ -182,26 +196,23 @@ port and only show the URL instead of opening the default browser directly:
182196
$ minikube dashboard --port=18080 --url=true
183197
```
184198
185-
Second, we can use the `kubectl proxy` command to enable access to the dashboard. The following
186-
command sets up the proxy to listen on any network interface (useful for remote access), to the
187-
18080/tcp port (easy to remember), and with requests filtering disabled (less secure, but necessary):
199+
Second, we can use the `kubectl port-forward` command to enable access to the dashboard:
188200
189201
```sh
190-
$ kubectl proxy --address=0.0.0.0 --port 18080 --disable-filter=true
202+
$ kubectl port-forward svc/kubernetes-dashboard -n kubernetes-dashboard 30090:80
191203
```
192204
193-
We can now access the minikube dashboard through the proxy. Use the following URL as a template,
194-
replacing the IP address with your workstation IP address:
195-
`http://192.168.0.1:18080/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/#/`
205+
We can now access the minikube dashboard on `http://localhost:30090`
196206
197207
## Troubleshooting
198208
199-
Note - The steps described are executed on a Fedora 35 workstation, but will likely work on any recent Linux distribution.
200-
The only prerequisites are to enable virtualization extensions in the BIOS/EFI of the machine, to install libvirt and to add our user to the libvirt group.
209+
Note - The steps described are executed on a Fedora 38 workstation, but will likely work on any recent Linux distribution.
210+
211+
- For minikube setups that rely on virtualization, the only prerequisites are to enable virtualization extensions in the BIOS/EFI of the machine, to install libvirt and to add our user to the libvirt group.
201212
202213
- Ensure that your minikube installation directory is available in your `$PATH` environment variable. This is usually `/usr/local/bin/` or something similar depending on your OS of choice.
203214
204-
- The following command gives us the IP address assigned to the virtual machine created by Minikube.
215+
- The following command gives us the IP address assigned to the node created by Minikube.
205216
It's used when interacting with tackle UI image installed on the minikube cluster.
206217
207218
```sh
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)