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

Harmonize default value for REANA_HOSTNAME #867

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

Alputer
Copy link
Member

@Alputer Alputer commented Jan 31, 2025

This PR is part of harmonizing the treatment of REANA_HOSTNAME accross all REANA components. You can refer to other PRs below.

reanahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes #865

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 16.66667% with 10 lines in your changes missing coverage. Please review.

Project coverage is 31.04%. Comparing base (b2074bc) to head (8acfb28).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
reana/reana_dev/cluster.py 11.11% 8 Missing ⚠️
reana/reana_dev/run.py 33.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #867      +/-   ##
==========================================
- Coverage   31.07%   31.04%   -0.04%     
==========================================
  Files          26       26              
  Lines        2491     2500       +9     
==========================================
+ Hits          774      776       +2     
- Misses       1717     1724       +7     
Files with missing lines Coverage Δ
reana/reana_dev/run.py 54.58% <33.33%> (+0.22%) ⬆️
reana/reana_dev/cluster.py 47.19% <11.11%> (-1.64%) ⬇️

Alputer added a commit to Alputer/reana-workflow-controller that referenced this pull request Jan 31, 2025
…#630)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-server#717

Closes reanahub/reana#865
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from 97a6a01 to 54ec108 Compare January 31, 2025 11:50
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from 54ec108 to db4c4ae Compare January 31, 2025 12:52
Alputer added a commit to Alputer/reana-workflow-controller that referenced this pull request Jan 31, 2025
…#630)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-server#717

Closes reanahub/reana#865
Alputer added a commit to Alputer/reana-server that referenced this pull request Jan 31, 2025
…#717)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-workflow-controller#630

Closes reanahub/reana#865
@@ -166,7 +166,7 @@ spec:
value: "true"
{{- if .Values.reana_hostname }}
- name: REANA_HOSTNAME
value: {{ .Values.reana_hostname }}
value: {{ .Values.reana_hostname | default "localhost:30443" }}
Copy link
Member

Choose a reason for hiding this comment

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

Note that if we make reana_hostname to be mandatory and to have a nice default value in the Helm chart, then these conditional default strings would not be needed everywhere.

Copy link
Member

Choose a reason for hiding this comment

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

We may have a problem with the treatment of port numbers.

(1) With the current PR and using:

reana_hostname: localhost

I'm getting missing port numbers in the Dask service URL:

reana=# select * from __reana.service ;
                 id_                  |         name          |                                   uri                                   | status  | owner_id | type_
--------------------------------------+-----------------------+-------------------------------------------------------------------------+---------+----------+-------
 f910b6ef-7fc6-434f-8d56-3bc4c22890fd | dask-service-cb18c6cd | https://localhost/cb18c6cd-2cc2-44ea-8f0f-2addec5722ec/dashboard/status | running |          | dask
(1 row)

(The real URL should be https://localhost:30443/cb18c6cd-2cc2-44ea-8f0f-2addec5722ec/dashboard/status.)

(2) And, if someone would like to customise Helm chart to use hostname including port number:

reana_hostname: localhost:30443

then this would lead to an installation error:

Error: INSTALLATION FAILED: 1 error occurred:
        * Ingress.networking.k8s.io "reana-ingress" is invalid: spec.rules[0].host: Invalid value: "localhost:30443": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

We may perhaps need to introduce another Helm chart value concerning port information, or subtract the port information from reana_hostname when constructing ingress values.

I guess it may be better to have a new variable about port, and set it by default to 30443, and people could customise it to whatever they wish. (Could be handy if you'd like to run two REANA deployments on the same machine, e.g. for testing purposes.)

(3) Similarly, we may want to beware about HTTP vs HTTPS ports, because some installations terminate SSL early via say HAProxy, and comunicate using HTTP with REANA infrastructure afterwards, as desrcibed in https://docs.reana.io/administration/configuration/configuring-cluster-ingress/#using-reverse-proxy)

@@ -95,7 +95,7 @@ metadata:
"helm.sh/resource-policy": keep
type: kubernetes.io/tls
data:
{{- $cert := genSelfSignedCert (.Values.reana_hostname | default "localhost") nil nil 90 }}
{{- $cert := genSelfSignedCert (.Values.reana_hostname | default "localhost:30443") nil nil 90 }}
Copy link
Member

Choose a reason for hiding this comment

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

For certificate purposes, I think one does not use the port information.

Alputer added a commit to Alputer/reana-server that referenced this pull request Jan 31, 2025
…#717)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-workflow-controller#630

Closes reanahub/reana#865
Alputer added a commit to Alputer/reana-workflow-controller that referenced this pull request Jan 31, 2025
…#630)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-server#717

Closes reanahub/reana#865
Alputer added a commit to Alputer/reana-workflow-controller that referenced this pull request Jan 31, 2025
…#630)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-server#717

Closes reanahub/reana#865
@Alputer Alputer closed this Jan 31, 2025
@Alputer Alputer force-pushed the fix-reana-hostname branch from db4c4ae to b2074bc Compare January 31, 2025 14:08
Alputer added a commit to Alputer/reana-workflow-controller that referenced this pull request Jan 31, 2025
…#630)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-server#717

Closes reanahub/reana#865
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer reopened this Jan 31, 2025
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from a256dc4 to c0d777b Compare January 31, 2025 14:39
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from c0d777b to ff95a22 Compare January 31, 2025 14:41
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from ff95a22 to e0eb2bc Compare January 31, 2025 14:45
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch 2 times, most recently from 35b0d25 to 7a8906d Compare January 31, 2025 14:57
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from 7a8906d to 9d2af59 Compare January 31, 2025 15:02
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from 9d2af59 to 063b416 Compare January 31, 2025 15:04
Alputer added a commit to Alputer/reana-workflow-controller that referenced this pull request Jan 31, 2025
…b#630)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-server#717

Closes reanahub/reana#865
Alputer added a commit to Alputer/reana-workflow-controller that referenced this pull request Jan 31, 2025
…b#630)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-server#717

Closes reanahub/reana#865
Alputer added a commit to Alputer/reana that referenced this pull request Jan 31, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from 063b416 to 0d654fa Compare January 31, 2025 16:23
Alputer added a commit to Alputer/reana-workflow-controller that referenced this pull request Jan 31, 2025
…b#630)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-server#717

Closes reanahub/reana#865
Alputer added a commit to Alputer/reana-workflow-controller that referenced this pull request Jan 31, 2025
…b#630)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-server#717

Closes reanahub/reana#865
Alputer added a commit to Alputer/reana that referenced this pull request Feb 3, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from 0d654fa to e705cd3 Compare February 3, 2025 11:08
@@ -283,6 +302,12 @@ def cluster_build(
callback=validate_mode_option,
help="In which mode to run REANA cluster? (releasehelm,releasepypi,latest,debug) [default=latest]",
)
@click.option(
"--port",
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: ‏Might be good to call the variable --hostport for full compatibility with the Helm chart value naming.

# production deployments to be secure. The default `localhost` value is used
# in local deployment scenarios.

reana_hostport: 30444
Copy link
Member

Choose a reason for hiding this comment

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

todo: ‏Shouldbe 443 by default.

# in local deployment scenarios.

reana_hostport: 30444
# `reana_hostport` should be set to same port you expose in your ingress controller.
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: ‏You can rather explain that "... should be set to the port number where the REANA service will be exposed for incoming SSL connections." (Kind of using outward user-oriented language, not inward ingress-oriented language.)

@@ -170,7 +174,7 @@ traefik:
web:
nodePort: 30080
websecure:
nodePort: 30443
nodePort: 30444
Copy link
Member

Choose a reason for hiding this comment

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

todo: ‏You should revert back to 30443 after testing is done.

@@ -86,6 +92,7 @@ def cluster_create(
$ reana-dev cluster-create -m /var/reana:/var/reana
-m /usr/share/local/mydata:/mydata
--mode debug
--extra-ports 30080 30443 5000
Copy link
Member

Choose a reason for hiding this comment

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

todo: ‏I'm note sure port 5000 would work, Kind/K8s may need ports above 30000. You can use a realistic exampe of 30444 for running a second REANA instance in the documentation pages.

{"containerPort": 30080, "hostPort": 30080, "protocol": "TCP"}, # HTTP
{"containerPort": 30443, "hostPort": 30443, "protocol": "TCP"}, # HTTPS
],
"extraPortMappings": extra_port_mappings, # Only user-specified ports
Copy link
Member

Choose a reason for hiding this comment

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

question: ‏Before, 30080 and 30443 were automatically added. Now, they would not be, so developers would have to pass `--extra-ports 30080 30443 manually. Perhaps you can check the argument, and if nothing was specified, fall back to 30080 and 30443, so that old behaviour would work out of the box?

@@ -288,6 +294,7 @@ def run_ci(
-c r-d-helloworld
--exclude-components=r-ui,r-a-krb5,r-a-rucio,r-a-vomsproxy
--mode debug
--port 30500
Copy link
Member

Choose a reason for hiding this comment

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

todo: ‏Please use realistic examples, i.e. 30443 default value. The help would be more easily copy-pasteable.

@@ -42,7 +43,7 @@ kubectl -n "${kubernetes_namespace}" create secret generic "${instance_name}"-ad
# Success!
echo "Success! You may now set the following environment variables:"
echo ""
echo " $ export REANA_SERVER_URL=https://localhost:30443 # or use your URL"
echo " $ export REANA_SERVER_URL=https://localhost:${reana_hostport} # or use your URL"
Copy link
Member

Choose a reason for hiding this comment

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

suggestion:localhost still stays hard-coded here. If we want to pass the host port, we should probably pass the host name too, for consistency. Alternatively, let's just keep the old content, i.e. not introduce any new argument, since the localhost:30443 part is only printed out as a help. I guess I would prefer the latter, so that we don't change the number of arguments to this script. (It does not seem necessary to know the port number when creating an admin user...)

Alputer added a commit to Alputer/reana that referenced this pull request Feb 3, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
Alputer added a commit to Alputer/reana that referenced this pull request Feb 3, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from aabf388 to 28bf617 Compare February 3, 2025 13:04
Alputer added a commit to Alputer/reana that referenced this pull request Feb 3, 2025
This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from 28bf617 to 94b7ef6 Compare February 3, 2025 13:05
Alputer added a commit to Alputer/reana-workflow-controller that referenced this pull request Feb 3, 2025
…b#630)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components. You can refer to other PRs below.

reanahub/reana#867
reanahub/reana-server#717

Closes reanahub/reana#865
Alputer added a commit to Alputer/reana that referenced this pull request Feb 3, 2025
…b#867)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reenahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from 94b7ef6 to e3caee4 Compare February 3, 2025 14:35
…b#867)

This PR is part of harmonizing the treatment of REANA_HOSTNAME
accross all REANA components and introduces REANA_HOSTPORT Helm
value. You can refer to other PRs below.

reanahub/reana-server#717
reanahub/reana-workflow-controller#630

Closes reanahub#865
@Alputer Alputer force-pushed the fix-reana-hostname branch from e3caee4 to 8acfb28 Compare February 3, 2025 14:37
@tiborsimko tiborsimko merged commit 8acfb28 into reanahub:master Feb 3, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

helm: harmonise the treatment of reana_hostname
2 participants