Python dependencies

Hi folks

Using Python this year because of reasons.

How should I handle dependencies? Just upload the whole virtual environment (what are the size limits for this)? Or create a py2exe (how should I instruct the engine to run this, also size limit)? Docker image? Or only use whatever libraries the server has installed, in which case can you list them please?

Thanks a ton. And well done on the theme, it got our whole office excited!

1 Like

Extending this further, can our bot make calls to external servers? Could I host my own bot in the cloud and call it from the local game, or do I have to embed everything into the local machine? May I install a Windows-Service that is called by the bot, perhaps on the same machine or network?

Hey Justin, From past experiences you will not be allowed to connect to the net. This did come up in earlier years. Connecting to any other servers were not allowed. Doubt they would change it this year…

Also if we took something like battleships, If a server connection was possible it would be possible to make slight updates to the bot after the final submissions have closed and in doing so change the bot based on opposing strategy. Also Entelect needs to be able to assess the bot’s opensource code to make sure there’s no mal behavior like memory scanning etc.

Regarding installing a windows service. I am not sure what they will permit. But im sure that hosting your bot in the cloud is a no. Also I believe it is impractical. If the network gives the slightest delay or troubles the bot will timeout resulting in missed rounds. And in this challenge. Once advantage is lost, Its game over.

1 Like

@Justin, @WillieTheron is right. Your bot will under no circumstance be allowed to have network connections or install windows services, and any such actions will result in immediate disqualification. The bot must run completely stand alone. This is for both reasons mentioned above and also to make sure all the bots run in the same and fair environment, with the same resources.

@pete, as for the question about the dependencies. Traditionally we supported package managers for the various languages that will download the libs needed to build and run the bots. This might possibly change since the bots will run in docker containers where libs might be pre-installed. We will provide you with more information once the docker images are finalized.

Thanks Edwin. If you give me Numpy, Pickle, H5PY, Keras and Tensorflow pre-installed then most of my problems will be solved.

1 Like

Howdy! The 10th of June is approaching fast. Have you guys finalised these images yet?

Hi @pete

We have finalised the images and the python packages we have available are as follows:

  • Tensorflow (only Python) 1.7
  • Numpy 1.13
  • Pickle 12 (python3) and 11(python2)

Also please keep in mind that there is no GPU support on our servers for if you intend on doing intensive calculations.

Let me know if you have any further questions.

Thanks so much baie dankie. No Keras though? Ouch. And no way of pulling the package? Or if I just compile the whole thing into an exe and pretend it’s a c++ bot, will that do the trick?

@pete,

Unfortunately for the first tournament we won’t be supporting Keras no.
We will look into it for the following tournaments and let you know if and when it will be supported.

In regards to compiling it as a c++ bot, that won’t work either as we will be compiling the bots on our side, so it will try and compile a c++ bot and fail.

Cheers for the follow-up. Looks like someone is learning Tensorflow this weekend. :confused:

So rather unexpectedly in Tensorflow 1.7+ you seem to be able to reference tf.keras, so great success (in case anyone else cared).

However, loading up a model becomes rather challenging without h5py. No chance whatsoever of having this library available?

1 Like

Hey @pete

That should be fine :slight_smile: As long as it is defined in the requirements.txt file when uploading your bot, there shouldn’t be much of an issue with having the library available.

Thanks, that is great news!

Hey guys, I started using tensorflow a couple of days ago and now tried to run my bot using the game launcher, and it gives the error: no module named tensorflow. This is strange because when I run the code through Pycharm or the command line, it succesfully runs. I’m a tensorflow noob, and have no idea why this is happeining. Any help would be appreciated.:slight_smile: I’m on a mac btw.

I have zero Mac skills I’m afraid. But the Windows python installation came with the python launcher py.exe which sits in the Windows directory. My problems had to do with where py.exe was directing the test harness. I had multiple virtual environments running, but this launcher kept pointing to an ancient installation which was missing the dependencies.

Another poster alluded to creating a symbolic link that points “py” to your specific python installation.

Not sure if this information is of any use on your Mac though, so best I can say is good luck!

Thanks! I think the problem is the launcher is running my code with python 2, even though I set the language to python3. Is there a way to make the game runner explicitly run python3?

Looking at the bot runners, it looks like on Windows they call py -2 and py -3, but on Linux they both call python.

Not sure if this is intended or not, but as a result it will do the right thing if you activate a Python 3 virtualenv before running the game runner in the same shell.

That worked. Thanks a lot! :slight_smile: