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

Supporting TECA_assets svn repo in TECA #351

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

elbashandy
Copy link
Contributor

@elbashandy elbashandy commented Apr 29, 2020

Moved deeplab models + png/jpg files to TECA_assets

Resolves #477

@elbashandy elbashandy requested a review from burlen April 29, 2020 22:20
@burlen
Copy link
Collaborator

burlen commented May 1, 2020

it's looking good so far. We need to add a cmake target to fetch assets during build. So for instance one could say "make TECA_assets" and this would trigger a svn co or svn up. Would also like such a target for TECA_data. Both these targets need to be configurable to be in or out of the default target.

See also:
https://cmake.org/cmake/help/latest/module/ExternalProject.html
https://cmake.org/cmake/help/v3.17/module/FetchContent.html

@elbashandy
Copy link
Contributor Author

@burlen I set TECA_DATA_REQ to be our flag that we can set if we want to TECA_data to be downloaded. Do you think something like this could work?

set(TECA_DATA_REQ OFF CACHE BOOL "require TECA_data or not")
if (TECA_DATA_REQ)
    FetchContent_Declare(
        TECA_data
        SVN_REPOSITORY svn://svn.code.sf.net/p/teca/TECA_data
    )
    FetchContent_GetProperties(TECA_data)
    if(NOT TECA_data_POPULATED)
        FetchContent_Populate(TECA_data)
        add_subdirectory(${TECA_data_SOURCE_DIR})
    endif()

    set(TECA_DATA_ROOT ${TECA_data_SOURCE_DIR})
else()
    set(TECA_DATA_ROOT "/path/to/TECA_data"
        CACHE PATH "Path to TECA_data repository")
endif()

set(tmp OFF)
if (EXISTS "${TECA_DATA_ROOT}")
    set(tmp ON)
    message(STATUS "TECA_data -- available")
elseif (REQUIRE_TECA_DATA)
    message(FATAL_ERROR "TECA_data -- required but not found")
else()
    message(STATUS "TECA_data -- not available")
endif()
set(TECA_HAS_DATA ${tmp} CACHE BOOL "TECA_data is present")

@taobrienlbl taobrienlbl added the 1_high_priority an issue that should be fixed prior to the next release label Jun 19, 2020
Copy link
Collaborator

@burlen burlen left a comment

Choose a reason for hiding this comment

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

Looks good (but please notice that I flagged minor tweak in the code comments). Also I don't see the cmake code to fetch the repo. This would be needed for deployment on PyPi. Comments above have links to the relevant cmake functions. I'd like to see this incorporated.

test/travis_ci/install_osx.sh Outdated Show resolved Hide resolved
@elbashandy elbashandy changed the title Supporting TECA_assets svn repo in TECA [WIP] Supporting TECA_assets svn repo in TECA Sep 16, 2020
@elbashandy elbashandy force-pushed the teca_assets_svn_support branch 2 times, most recently from 0b2a677 to ca41579 Compare September 18, 2020 21:20
@elbashandy elbashandy changed the title [WIP] Supporting TECA_assets svn repo in TECA Supporting TECA_assets svn repo in TECA Sep 18, 2020
@burlen burlen removed the 1_high_priority an issue that should be fixed prior to the next release label Sep 21, 2020
Copy link
Collaborator

@burlen burlen left a comment

Choose a reason for hiding this comment

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

Hi Abdel, solid progress was made, but I flagged a few issues. In addition to comments in the code, also need to install the assets by make install.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
CMakeLists.txt Outdated
CONFIGURE_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND "" LOG_DOWNLOAD 1)
ExternalProject_Get_property(TECA_assets SOURCE_DIR)
set(TECA_ASSETS_ROOT ${SOURCE_DIR})
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe that this will make a new variable and will not update the cached variable of the same name declared above. The cmake docs confirm this. This code should be restructured so the second variable is not needed. https://cmake.org/cmake/help/v3.18/manual/cmake-language.7.html#cmake-language-variables

echo "usage: test_deeplabv3p_ar_detect_app.sh [app prefix] " \
"[data root] [mpi exec] [test cores]"
echo "usage: test_deeplabv3p_ar_detect_app.sh [app prefix] " \
"[data root] [assets root] [mpi exec] [test cores]"
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should no longer have to pass this on the command line , use the functions you added in teca_py_config.i

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I applied this change only to the test_deeplabv3p_ar_detect.py test in 8a8bdb. However I didn't do this to the app because the user is expected to pass the deeplab model path to the command line --pytorch_deeplab_model. That's why [assets root] is being passed to this bash file

Copy link
Collaborator

@burlen burlen Nov 18, 2020

Choose a reason for hiding this comment

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

You need to update the command line application. You could leave the command line option, so that one could pass the model there. The default should be that the model is taken from the assets directory. Having the model available internally(in the install) is the point of deploying the assets with TECA and the app should make use of it.

@@ -484,7 +484,7 @@ Example
.. code-block:: bash

mpiexec -np 10 ./bin/teca_tc_trajectory_scalars \
--texture ../../TECA_data/earthmap4k.png \
--texture ../../TECA_assets/earthmap4k.png \
Copy link
Collaborator

Choose a reason for hiding this comment

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

we no longer need to pass on the command line, the default value can be obtained using the new api you defined in teca_py_config.i

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should do that because this is given as a command line argument to the --texture option in the teca_tc_trajectory_scalars app. We can modify it to /path/to/background_image.png if that makes sense. Please let me know if I am missing something.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You might be missing that the point of deploying the assets with TECA is that we no longer need to pass these on the command line. It's fine to leave the command line options but make them optional, with the default value pointing to the assets location. Same deal as with the pytorch model.

CMakeLists.txt Show resolved Hide resolved
SVN_REPOSITORY svn://svn.code.sf.net/p/teca/TECA_data
UPDATE_COMMAND svn update
CONFIGURE_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND "" LOG_DOWNLOAD 1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

how verbose is this? is it disruptive to display in the terminal? if it is not too bad doing so may help a user understand what's going on. I'll leave that call up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is a little disruptive especially to the progress percentage-values that we get at the building process.

@@ -710,7 +712,7 @@ \subsection{Command Line Arguments}
\subsection{Example}
\begin{minted}{bash}
mpiexec -np 10 ./bin/teca_tc_trajectory_scalars \
--texture ../../TECA_data/earthmap4k.png \
--texture ../../TECA_assets/earthmap4k.png \
Copy link
Collaborator

Choose a reason for hiding this comment

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

use the new api in teca_py_config.i to fetch a default internally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should do that because this is given as a command line argument to the --texture option in the teca_tc_trajectory_scalars app. We can modify it to /path/to/background_image.png if that makes sense. Please let me know if I am missing something.

Copy link
Collaborator

Choose a reason for hiding this comment

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

see comments above.

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated
CONFIGURE_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND "" LOG_DOWNLOAD 1)
ExternalProject_Get_property(TECA_data SOURCE_DIR)
set(TECA_DATA_ROOT ${SOURCE_DIR})
Copy link
Collaborator

Choose a reason for hiding this comment

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

restructure this as explained in section re: assets below

@elbashandy elbashandy force-pushed the teca_assets_svn_support branch 3 times, most recently from 8a8bdb2 to 29a5bd9 Compare October 10, 2020 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use subversion to fetch deployable assetts
3 participants