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

Option to force a specific hostname #3337

Closed
JStateson opened this issue Oct 16, 2019 · 17 comments · Fixed by #3620
Closed

Option to force a specific hostname #3337

JStateson opened this issue Oct 16, 2019 · 17 comments · Fixed by #3620

Comments

@JStateson
Copy link

Problem: When creating multiple clients, some users (the SUG comes to mind) edit the client_state.xml file changing a few characters in the <host_cpid> field. A better solution would be to assign a unique hostname and let the client calculate the correct cpid. I code this feature into the 7.16.3 source (not sure how old my source is now)
The changes were made to
client_state.cpp & h
cs_cmdline.cpp
hostinfo_network.cpp
hostinfo.cpp & h

Example of how to use it follows:

jstateson@jyslinux1:~/Downloads/boinc-master/client$ ./boinc --help
The command-line options for ./boinc are intended for debugging.
The recommended command-line interface is a separate program,'boinccmd'.
Run boinccmd in the same directory as ./boinc.


Usage: ./boinc [options]
    --abort_jobs_on_exit           when client exits, abort and report jobs
    --allow_remote_gui_rpc         allow remote GUI RPC connections
    --allow_multiple_clients       allow >1 instances per host
    --attach_project <URL> <key>   attach to a project
    --force_hostname <name>        use this as hostname-jys
    --check_all_logins             for idle detection, check remote logins too
    --daemon                       run as daemon (Unix)

It would be used as follows (for example):

sudo ./boinc --force_hostname test0 --gui_rpc_port 31420 --dir /home/WOWevent/test0

the resulting client_state.xml file looks like this on my "jyslinux1" box (note that jyslinux1 is not there)

<client_state>
<host_info>
    <timezone>-18000</timezone>
    <domain_name>test0</domain_name>
    <ip_addr>192.168.1.169</ip_addr>
    <host_cpid>cbf8fadc4b0de158ac46a0450e7f42ec</host_cpid>
    <p_ncpus>12</p_ncpus>

Useful, but not required, would be to edit /etc/hosts to include "test0" such as on the following line

127.0.0.1 test0 localhost

@davidpanderson
Copy link
Contributor

I don't understand the use case here.
Why are people copying client_state.xml?

@JStateson
Copy link
Author

JStateson commented Oct 17, 2019

I have not written any formal use case since about 2007. Actually, I was hoping those would disappear along with CORBA but it seems only the CORBA has fallen out of favor since I retired.

Copying can occur for a number of reasons, sometimes recovering from a crash, creating a system with copy and paste from another, or you are given a zip as in "try this".

I posted here after making a few "wishes" over at the Boinc community. It was suggested to come here and have some working code so I made a mod to see if my idea would work and brought it here. Actually, I just wanted the developers to comment on it as to whether it was worth implementing.

There are two things going on here. One, as mentioned, concerns users (usually SETI) editing the <host_cpid> field so as to get additional hosts (multple clients). I thought it best if the host name was changed so that the client would generate it's own correct CPID. Secondly, a user may want to have a specific name for their system that is visible on the public project web but is different from the domain name. For example "BigBadPrimeBuster" instead of "IRSFieldUnit13" As far as I know there is no way to do this without changing the computers domain name.

I ran a few tests, only under Linux, and was able to specify any name I wanted for my Boinc system and it seems to work just fine. I have written a number of 3rd party apps for Boinctasks using C#.
https://forum.efmer.com/index.php?board=47.0

I would like to do the same here but I try to avoid C++ and have only recently made some mod's to the Boinc client. I thought this idea might be useful so I brought it here.

@RichardHaselgrove
Copy link
Contributor

a specific name for their system that is visible on the public project web

Computer names are not visible to the public. They are only shown to the logged-in user of the account - who presumably won't be embarrassed by them.

@davidpanderson
Copy link
Contributor

Copying client_state.xml to a different computer is a bad thing;
we shouldn't do anything that encourages it.

@JStateson
Copy link
Author

JStateson commented Oct 17, 2019

a specific name for their system that is visible on the public project web

Computer names are not visible to the public. They are only shown to the logged-in user of the account - who presumably won't be embarrassed by them.

I do not follow you here. At a website, if computers are not hidden (the usual case) then the domain name ie "computer name" is certainly visible. Every computer I have ever used has it name listed going to the beginning of Boinc on every project I have contributed. If you have a system at work, home, or school, how does one select a different name during the installation of boinc if you don't want the actual computer name to be visible? In addition it would be useful, on occasion, to have additional clients with different names. The mod I put in uses the client to create a new client_state.xml and avoids having to copy, let alone edit, that xml. Possibly there is a way I might have missed that during the installation. I only discovered recently the "add on" to Boinc that is on the main Boinc page.

@RichardHaselgrove
Copy link
Contributor

Yes - it's visible to you: it's your machine. Try looking at somebody else's machine - mine, for example.

@JStateson
Copy link
Author

JStateson commented Oct 17, 2019

Yes - it's visible to you: it's your machine. Try looking at somebody else's machine - mine, for example.
You are correct, only ID's are shown

However my purpose was to enable additional clients and not have to edit the client_state.xml This is not a normal thing and only a few users might have a need for additional clients. Very likely there is no need for this and I will close this issue in another day or so unless someone objects.

[edit] - Occasionally, on forums, I see screen shots of systems displayed where the names are visible so this would allow a personalized name for the system to be displayed.

@RichardHaselgrove
Copy link
Contributor

Yes. BOINC supports <allow_multiple_clients> (cc_config.xml) or --allow_multiple_clients (command line): if these options are to be exploited, I agree that allowing the owner to distinguish between them could be advantageous. But please don't over-complicate the case by suggesting additional, spurious, justifications.

@JStateson
Copy link
Author

JStateson commented Oct 17, 2019

That "additional justification" could be a separate issue. For example "Allow nickname for computers on project servers" Instead of having IDs show up, the nickname would be visible. That would be a PITA to implement. As it is, some projects (gpugrid for example) have server code so old that the google captcha version they are using no longer works. It is no longer possible to edit personal profile info and gpugrid is not the only one with old code. I would think the feature to "Allow nickname for computers" would never be implemented and is not worth creating an issue for it IMHO. I recently changed my personal nickname from "BeemerBiker" and every forum got updated include really old comments in forums. I was impressed and thankful also.

[edit] Adding a request for an optional hostname during installation might also work for issues #2721 #2846 dealing with android domain name. I am only iPhone literate so cannot really contribute to that discussion.

@truboxl
Copy link
Contributor

truboxl commented Oct 19, 2019

  1. Correct me if I am wrong but editing client_state.xml is pretty much pointless when the client get its information like computer's hostname at next client start and will update accordingly if the hostname is changed without changing CPID or any ID

    Is there any reason you cant do it from hostnamectl or sysdm.cpl? don't want to change the box's hostname?

  2. The issues listed for Android is well you can't really change the default name of the device up until now. Come to think of it, a little research reveals Android officially gained the ability to change to user inputted device name through Settings app since 6.0. So from BOINC perspective, if not because older Android cannot do the name change without hoops, there's probably no reason to do its own name change on Android client.

    Note that the above mentioned is device name and not hostname.
    hostname on Android is pretty much fixed as localhost and may even be NULL so using root to change it won't do much favour as hostname rarely used in Android apps.

  3. Are you trying to run multiple clients on a single machine? If that's the case, I think starting a fresh ID for a new client is better than sharing (or worse copying) the same ID from another client so as to avoid conflict. Distinguish clients in this sense through an additional name looks like a good idea to me, but then again there's reasons NOT to run multiple clients on a single machine anyway since majority BOINC users do not do that.

@JStateson
Copy link
Author

JStateson commented Oct 19, 2019

1- Correct me if I am wrong but editing client_state.xml is pretty much pointless..
2-
3. Are you trying to run multiple clients on a single machine? If that's the case, I think starting a fresh ID for a new client is better than sharing (or worse copying) the same ID from another client so as to avoid conflict. Distinguish clients in this sense through an additional name looks like a good idea to me..

You are correct on all three. The feature suggested was basically to allow easy setup of multiple clients that would be controlled by, for example, Boinctasks. Currently, there are a few users (like you said, not many) who DO copy the client_state and edit it manually to change the hostname (client, not system) and the CPID and the number of GPUs (spoofing large number) in their system.

I looked at doing that, did not like it as the name reverted like you mentioned in 1, and I made a change to the client adding the features: --force_hostname as well as --set_password to allow easy install of additional clients w/o sharing, copying, or editing. These changes had to be augmented with a script to create the global_preferences and cc_config for each addition client.

I got the idea for doing this after I participated in a "crunch" and found that (a few ?) other participants had been running multiple clients for a month or more before the scheduled "crunch" and had delayed submitting their results until the event started. This was possible because the event sponsors do not bother to check if the results turned in were collected before the event. I myself do not have a problem with that as the data needs to be crunched one way or another but I thought I could put together a procedure to handle multiple clients for users who want to compete but lack the skills to handle multiple clients.

That being said, there are other reasons to make it easier to handle multiple clients. I myself have a pair of mining rigs each with 6 GPUs. The GPUs are not identical and it is convenient to have an additional client to handle certain GPUs differently. Typically, this would involove only two clients not 10 or 100 or more clients like is seemingly done for certain events.

@adamradocz
Copy link
Member

I don't get what's the point running multiple boinc instances on the same machine?

@JStateson
Copy link
Author

JStateson commented Oct 20, 2019

There are a few legit reasons and a few "other" reasons

Legit use: the project allows certain features only for a particular device but the client cannot distinguish between devices.

For example: With app "MW", the AMD s9100 can process 5 concurrent tasks efficiently but the RX-570 chokes badly with more than 2 tasks.
The app "MW" reads the contents of "app_config.xml" to see how many tasks to assign and asks the client for an "opencl" platform.
The client simply picks one graphic board to use out of the pool of graphics boards. With one client and 2 different boards, there is a %50 chance of getting the best resource to use.
With two clients the pool can be limited to as to assign the best resource all the time.

Other use: There may be a limit on downloading work units, say for example, 1000. With 100 clients one can download 100*1000

I looked at your docker project and you are using a c# RpcClient. Is there a plain jane "c" one avaialble? I also have a C# one I got from somwhere but it cant be used in ubuntu.

@adamradocz
Copy link
Member

adamradocz commented Oct 20, 2019

For your use case, Pref 2.0 could be a solution. #2993

The C# RpcClient should work on Ubuntu. I tested on Debian.

@JStateson
Copy link
Author

JStateson commented Nov 1, 2019

If this change is approved, it would be convenient, at the same time, to be able to set the gui_rpc password.

--set_password  <password>         set GUI RPC password
--set_hostname <name>                use this name for client

I have implemented these changes to my win & linux clients for use on my mining systems and have not seen any problems.
[EDIT] discovered a problem and wrote it up as issue #3376

@RichardHaselgrove
Copy link
Contributor

I'm not sure that's a good security protocol. Does your code require that the current password is blank? If not blank, can the password be changed without verifying the old password?

@JStateson
Copy link
Author

JStateson commented Nov 1, 2019

The default (windows) installation password is a bunch of random characters buried down somewhere in ProgramData and one must find it and put it into the manager (BM or BT) or edit the file and delete all the characters. That seems to be a PITA when working with a lot of remote boinc systems. Possibly that is why it is left blank on Linux installs.

@AenBleidd AenBleidd modified the milestones: Client Release 7.18.0, Client Release 7.16.11 Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants