Skip to content

Commit

Permalink
Updated butterfly to work with OF1706+
Browse files Browse the repository at this point in the history
There has been a change in the naming structure of the image. This is
now fixed.

Resolved #269
  • Loading branch information
mostaphaRoudsari committed Aug 24, 2017
1 parent ee114d3 commit 917b50c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions butterfly/runmanager.py
Expand Up @@ -51,7 +51,8 @@ def __init__(self, projectName):
self.__projectName = projectName
self.__separator = '&'
self.isUsingDockerMachine = True \
if hasattr(Version, 'isUsingDockerMachine') and Version.isUsingDockerMachine \
if hasattr(Version, 'isUsingDockerMachine') and \
Version.isUsingDockerMachine \
else False

self.dockerPath = r'"C:\Program Files\Docker Toolbox"' \
Expand Down Expand Up @@ -94,8 +95,9 @@ def getShellinit(self):
err = '\n'.join(process.stderr)
if err:
if err.find('Error checking TLS connection: Host is not running') != -1:
msg = ' Docker machine is not running! Run Oracle VM VirtualBox Manager ' \
'as administrator and make sure "default" machine is "running".'
msg = ' Docker machine is not running! Run Oracle VM ' \
'VirtualBox Manager as administrator and make sure ' \
'"default" machine is "running".'
else:
msg = ''

Expand Down Expand Up @@ -123,7 +125,7 @@ def getContainerId(self):
return

for count, line in enumerate(p.stdout):
if line.find('of_plus') > -1:
if line.find('of_') > -1:
# find container
_id = line.split()[0]
print('container id: {}'.format(_id))
Expand Down Expand Up @@ -253,7 +255,7 @@ def __command(self, cmd, args=None, decomposeParDict=None, includeHeader=True):
"""
tee = 'tee'
res = namedtuple('log', 'cmd logfiles errorfiles')
_msg = 'Failed to find container id.' \
_msg = 'Failed to find container id. ' \
'Do you have the OpenFOAM container running?\n' \
'You can initiate OpenFOAM container by running start_OF.bat:\n{}' \
.format(self.__ofBatchFile)
Expand Down
4 changes: 2 additions & 2 deletions butterfly/version.py
Expand Up @@ -9,9 +9,9 @@ class Version(object):

BFVer = "0.0.4"
OFVer = "4.0"
OFFullVer = "v1612+"
OFFullVer = "v1706+"
isUsingDockerMachine = True # useful to run OpenFOAM container
lastUpdated = datetime(year=2017, month=5, day=11, hour=9, minute=44)
lastUpdated = datetime(year=2017, month=8, day=24, hour=13, minute=40)

def duplicate(self):
"""Return a copy of this object."""
Expand Down

7 comments on commit 917b50c

@leeyuan123
Copy link

Choose a reason for hiding this comment

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

@mostaphaRoudsari
Hi there, thank you very much for your excellent works so far. Can I ask if it is possible for butterfly to work with the latest version of OP (1712). If not, should I change some of the lines just like the example you've posted here and what are the lines that I should be changing.
thank you very much.

@mostaphaRoudsari
Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @leeyuan123, I haven't tested the new version but if they haven't changed the naming convention for the image it should work fine with 1712. Butterfly looks for a docker image that starts with of_.

@leeyuan123
Copy link

Choose a reason for hiding this comment

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

Hi @mostaphaRoudsari
Thank you very much for quick reply, it is definitely very appreciated.
I tried to update BF to the version that supports OP1706 by following the manual update instruction you have kindly suggested here. This is how it looks like now in my script folder:
script folder 1
script folder 2
script folder 3

It was very helpful indeed. However, we have this error message says: 1. Solution exception:'type' object has no attribute 'BFVer'. Which I'm not smart enough to figure it out. Can I ask you to offer your wonderful genius to help me solve this problem pls?
Best regard,
Leeyuan
type object has no attribute bfver

@leeyuan123
Copy link

Choose a reason for hiding this comment

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

Hi there,
I guess I've solved the problem by changing the lines you have suggested on this page and only replace these two files back into the 'butterfly' folder. This is how it looks like now. If this really works, I guess this could be the easiest solution to keep the butterfly up to date on this issue of OP version problem.
updated

However, I'm not sure if the OP is running normally, cause my log folder in outdoor_airflow is empty:
empty log

@mostaphaRoudsari
Copy link
Member Author

Choose a reason for hiding this comment

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

@leeyuan123, based on the header of readMe butterfly has successfully found the container. The issue can happen for some other reason. I suggest you open an issue on GitHub and see what others have to share. Also the components in your screenshot look old. Try to download the updated example files from GitHub:

https://github.com/ladybug-tools/butterfly-plus/tree/master/plugin/grasshopper/examplefiles

@liaochenxi
Copy link

Choose a reason for hiding this comment

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

Hi there, I got the same trouble that my log folder in outdoor_airflow is empty, did you solve this?

@devang-chauhan
Copy link
Member

@devang-chauhan devang-chauhan commented on 917b50c May 13, 2018

Choose a reason for hiding this comment

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

Please follow these steps to update your installation of Butterfly

Please sign in to comment.