#Horde Configuration (Docker)

1 messages · Page 1 of 1 (latest)

full sphinx
#

Ah, so it looks like I needed to duplicate the connection info in server.json into globals.json under the server clusters section, not entirely sure what purpose it serves to have the config in server.json but globals.json actually seems to be responsible for handling the connection. Now I'm getting Server failed "p4 info" query under the perforce servers page in horde, but I cannot find any other logs that indicate what specifically is at fault here.

undone tinsel
#

This was my original message before you made a thread, so you've probably noticed some things already:

hmm, the "perforce:1666" is the default value it tries to connect when it's not set... something seems to be overriding your perforce environment variables - but in general you put perforce servers in 2 places: A) server.json which is where horde monitors for changes and B) globals.json which is used by the agents

undone tinsel
full sphinx
#
          
System.Exception: Unknown Perforce cluster 'Default'
          
  at HordeServer.BuildConfig.GetPerforceCluster(String name, String serverAndPort) in /app/Source/Programs/Horde/Plugins/Build/HordeServer.Build/BuildConfig.cs:line 299
...``` so this is what I'm seeing now. I've renamed the cluster to something other than "Default" so I'm not sure where it is pulling this from. My Perforce server is using SSL which might be causing some of the issues. I've just tried copying .p4trust to the docker image from my root directory using ```docker cp .p4trust <container_id>:./root/.p4trust```, but to no avail (just following some online suggestions).
undone tinsel
full sphinx
#

Ah, OK will try that now

undone tinsel
#

and as for .p4trust make sure to also configure the P4TRUST variable to point to that file... or honestly, what I do all the time, spin up an instance of p4broker which will do ssl offload so your buildfarm can go without ssl

#

because with ssl it's a pain to deploy, because you have to copy p4trust everywhere, when your cert expires or you change it, you have to go around and change it everywhere etc.

full sphinx
#

So it seems it was both, it needed .p4trust but also the cluster set back to Default

#

Thanks, you're a star!

#

Still have no idea what I'm doing, but that is one step closer at least 😄

full sphinx
undone tinsel
#

not really... just environment variable like any other

#

but if it works with your current setup then you don't have to do it

full sphinx
#

OK, another question. I have a two local machines (laptop/desktop running windows) set up that are running the agent. I built the agents from source and used dotnet HordeAgent.dll SetServer -Url=http://my_server_ip:13340 -Default to configure appsettings.json for the agent with just the address of my server and then I'm just running HordeAgent.exe after initial configuration (I'd imagine this is where I've missed something). I've managed to enroll them both with the server, but they sit in a state where they sit there saying "Waiting for agent to be approved..." in the console output, but I've no idea how I'm supposed to do that as they've already been registered. The agents themselves are also marked as offline in the server (see attached image). Is there something else I need to configure for them to be available? I've been loosely using your example scripts as a reference @undone tinsel, but I've stripped things back to the bare minimum, so I'm only including perforce.globals.json and projects.globals.json at the moment, with the my_project.stream.json/my_project.project.json largely being the same as your example (just pointing at different endpoints/streams etc where relevant).

undone tinsel
full sphinx
#

I get this if I hit that page

#

Ah, interesting. There was a token generated on the server, but I had to grab it from the server logs and enter it as the token for the agent connection. I guess this token handshake is all handled under-the-hood if you use the installer?

#

Ah, there was a token mismatch for one of the agents that I manually set, but not for the other. Now one is connected, one isn't...

undone tinsel
#

well, regarding this, there are two ways to connect the agent:
A) provide a token - usually used for automated deployment using scaling groups etc... where agent doesn't have to be manually enrolled
B) let it go - when you start the agent without a token it connects to the horde and waits for you to accept it here on this page, when you do it receives token from horde and uses that forever more

full sphinx
#

OK, I'll try reseting the other one, thanks

#

Well it didn't auto-connect, but the logs did spit out the mismatch (id vs empty id), so I just copied that token to the appsettings.json of the other agent and it connected. Not sure where the actual issue is in my configuration that is causing the default token authentication process to fail.

#

Oh, maybe I didn't elevate permissions of the agent to administrator to allow it to rewrite the appsettings.json on first connection? Could that be it?

#

Either way, one step closer. Thanks!

undone tinsel
#

it stores the tokens it receives from horde in appdata

#

pretty much all you do is:

  • set up horde server
  • install your horde agent (for windows it's easiest to just use the msi installer)
  • enter server IP/domain in the installation process
  • once it's installed it auto-starts, at that point go to the enrollment and enroll it
  • done
full sphinx
#

This was user error on my part. I'm not using the installer at the moment as my docker image does not come bundled with the installer--or any tools for that matter--which I think is by design. Instead I built the executable--not the installer--from source. The output directory has a Defaults/agent.json which I assumed was being read at runtime that I attempted to use to configure my agent, but it did nothing. This is why I was using the SetServer command as it was mentioned in the online documentation w.r.t. starting the server, this command actually writes data into the local appsettings.json for the server location, hence my confusion regarding this config file.

What I didn't realise is that there is also a folder generated at C:\ProgramData\Epic\Horde\Agent that has an agent.json as well. This is the one that is being read at runtime. I started from fresh (i.e. no local modifications to the file appsettings.json) and entered my server details in this agent.json instead and all worked fine without needing the token to be manually set.

Is there somewhere I can grab the installer directly on GitHub? If not, I'll look at building that locally instead as that would've likely removed these issues entirely.

undone tinsel
#

Well, iirc you can get the full image which includes all the tools directly from GitHub images … its good for testing, but I personally don’t recommend it for production use as it pretty much ties the tools to the docker image, instead you usually start with empty image and manually upload the tools, allowing you to independently update them etc.

full sphinx
#

Ah, I didn't realise uploading them was the intended use-case. Good to know!

undone tinsel
#

Well, it depends… using bundled image is easier, using bare image is what epic does and generally allows you to customize tools etc.

#

But its also more work for that reason

full sphinx
#

OK, one more question. My project stream imports my engine stream (using import+). When my agent runs the conform step, it looks like it is importing the engine stream. Then when my job runs, it cleans down my imported engine directory, so my initial job to build all fails as there is nothing in the engine directory in the sandbox environment folder on my agent. Is there something I'm missing in the job configuration that stops this clean-up from happening? At least I think this is what is happening.

Thank you for all the help so far btw! I'm new to all of this so I'm sorry if any of my questions are stupid.

Edit: Just testing further, ignore the above for now.

undone tinsel
full sphinx
#

How on earth do I get Setup.bat and GenerateProjectFiles.bat to run on a Windows agent so that RunUAT.bat has all the dependencies it needs when running a full build of my project?

undone tinsel
#

You don’t… you run setup.bat before pushing to perforce and generateprojectfiles is not necessary to be ran