Honor IPV4_PREFIX in morph_chain config #83

Merged
fyrchik merged 1 commit from potyarkin/frostfs-dev-env:fix/remove-hardcoded-ip-address into master 2024-09-13 12:22:33 +00:00
Member

Bug: IPV4_PREFIX not honored by morph_chain config

Expected Behavior

Makefile variable IPV4_PREFIX should affect all service containers.

Current Behavior

morph_chain uses hardcoded value for bind address:

Addresses:
- "192.168.130.90:30333"

Possible Solution

--- a/services/morph_chain/protocol.privnet.yml
+++ b/services/morph_chain/protocol.privnet.yml
@@ -36,7 +36,7 @@ ApplicationConfiguration:
       Password: "one"
   RPC:
     Addresses:
-      - "192.168.130.90:30333"
+      - ":30333"
     Enabled: true
     SessionEnabled: true
     EnableCORSWorkaround: false

Steps to Reproduce (for bugs)

  • $ make up IPV4_PREFIX=192.168.131
    
  • $ docker logs morph_chain
    ...
    server error: failed to listen on 192.168.130.90:30333: listen tcp 192.168.130.90:30333: bind: cannot assign requested address
    ...
    $ docker inspect --format '{{ .State.Running }}' morph_chain
    false
    

Context

I was trying to launch devenv in a custom IPv4 subnet.

Regression

Is this issue a regression? (Yes / No) --> Kinda. Introduced by 79a11641ed, PR#236

@alexvanin, do you remember why the IP was hardcoded in the first place? Would switching to listen on :30333 affect anything? If not, listening on all interfaces inside the container appears to provide the easiest workaround.

# Bug: IPV4_PREFIX not honored by morph_chain config <!--- Provide a general summary of the issue in the Title above --> ## Expected Behavior Makefile variable `IPV4_PREFIX` [should](https://git.frostfs.info/TrueCloudLab/frostfs-dev-env/src/commit/2e67acbcb2af952933b87856083a6a926b840723/docs/basenet.md#ipv4_prefix-192-168-130) affect all service containers. ## Current Behavior morph_chain uses hardcoded value for bind address: https://git.frostfs.info/TrueCloudLab/frostfs-dev-env/src/commit/2e67acbcb2af952933b87856083a6a926b840723/services/morph_chain/protocol.privnet.yml#L38-L39 ## Possible Solution ```diff --- a/services/morph_chain/protocol.privnet.yml +++ b/services/morph_chain/protocol.privnet.yml @@ -36,7 +36,7 @@ ApplicationConfiguration: Password: "one" RPC: Addresses: - - "192.168.130.90:30333" + - ":30333" Enabled: true SessionEnabled: true EnableCORSWorkaround: false ``` ## Steps to Reproduce (for bugs) - ```console $ make up IPV4_PREFIX=192.168.131 ``` - ```console $ docker logs morph_chain ... server error: failed to listen on 192.168.130.90:30333: listen tcp 192.168.130.90:30333: bind: cannot assign requested address ... $ docker inspect --format '{{ .State.Running }}' morph_chain false ``` ## Context I was trying to launch devenv in a custom IPv4 subnet. ## Regression Is this issue a regression? (Yes / No) --> Kinda. Introduced by https://git.frostfs.info/TrueCloudLab/frostfs-dev-env/commit/79a11641ed1b2bc7d9c41104569eae20ac3953cd, [PR#236](https://github.com/nspcc-dev/neofs-dev-env/pull/236) @alexvanin, do you remember why the IP was hardcoded in the first place? Would switching to listen on `:30333` affect anything? If not, listening on all interfaces inside the container appears to provide the easiest workaround.
potyarkin added the
bug
label 2024-09-10 13:54:08 +00:00
potyarkin added 1 commit 2024-09-10 13:54:08 +00:00
[#83] Honor IPV4_PREFIX in morph_chain config
All checks were successful
DCO action / DCO (pull_request) Successful in 24s
7538bd9b17
Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
potyarkin requested review from alexvanin 2024-09-10 13:54:26 +00:00
Owner

@alexvanin, do you remember why the IP was hardcoded in the first place?

Unfortunately, I don't.

Would switching to listen on :30333 affect anything?

As far as it is inside of a container, don't see any issues with that. If it works, then let's do it.

I gonna add to review some core developers who use and update this repo more than I do.

> @alexvanin, do you remember why the IP was hardcoded in the first place? Unfortunately, I don't. > Would switching to listen on :30333 affect anything? As far as it is inside of a container, don't see any issues with that. If it works, then let's do it. I gonna add to review some core developers who use and update this repo more than I do.
alexvanin requested review from dstepanov-yadro 2024-09-12 14:51:00 +00:00
alexvanin requested review from aarifullin 2024-09-12 14:51:02 +00:00
alexvanin requested review from achuprov 2024-09-12 14:51:03 +00:00
Author
Member

As far as it is inside of a container, don't see any issues with that. If it works, then let's do it

It works, at least on my machine :)

> As far as it is inside of a container, don't see any issues with that. If it works, then let's do it It works, at least on my machine :)
potyarkin was assigned by alexvanin 2024-09-12 14:58:35 +00:00
alexvanin approved these changes 2024-09-12 14:58:45 +00:00
acid-ant approved these changes 2024-09-12 17:20:39 +00:00
aarifullin approved these changes 2024-09-13 08:21:07 +00:00
dstepanov-yadro approved these changes 2024-09-13 12:19:11 +00:00
fyrchik merged commit 7538bd9b17 into master 2024-09-13 12:22:33 +00:00
potyarkin deleted branch fix/remove-hardcoded-ip-address 2024-09-13 12:23:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-dev-env#83
No description provided.