X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=nepi%2Fresources%2Flinux%2Fapplication.py;h=4b60f463e43fe98022c1a3905a85eefd462533a7;hb=10ddf71cfe290a9de4ac06fc55b8d335b94c2d52;hp=9fd605d88d0848b21bee88b32a7873c772623926;hpb=941fd7f54114b824fa26563d389a7ae07426fe14;p=nepi.git diff --git a/nepi/resources/linux/application.py b/nepi/resources/linux/application.py index 9fd605d8..4b60f463 100644 --- a/nepi/resources/linux/application.py +++ b/nepi/resources/linux/application.py @@ -86,79 +86,81 @@ class LinuxApplication(ResourceManager): @classmethod def _register_attributes(cls): - command = Attribute("command", "Command to execute at application start. " - "Note that commands will be executed in the ${RUN_HOME} directory, " - "make sure to take this into account when using relative paths. ", - flags = Flags.Design) - forward_x11 = Attribute("forwardX11", "Enables X11 forwarding for SSH connections", - flags = Flags.Design) - env = Attribute("env", "Environment variables string for command execution", - flags = Flags.Design) - sudo = Attribute("sudo", "Run with root privileges", - flags = Flags.Design) - depends = Attribute("depends", - "Space-separated list of packages required to run the application", - flags = Flags.Design) - sources = Attribute("sources", - "semi-colon separated list of regular files to be uploaded to ${SRC} " - "directory prior to building. Archives won't be expanded automatically. " - "Sources are globally available for all experiments unless " - "cleanHome is set to True (This will delete all sources). ", - flags = Flags.Design) - files = Attribute("files", - "semi-colon separated list of regular miscellaneous files to be uploaded " - "to ${SHARE} directory. " - "Files are globally available for all experiments unless " - "cleanHome is set to True (This will delete all files). ", - flags = Flags.Design) - libs = Attribute("libs", - "semi-colon separated list of libraries (e.g. .so files) to be uploaded " - "to ${LIB} directory. " - "Libraries are globally available for all experiments unless " - "cleanHome is set to True (This will delete all files). ", - flags = Flags.Design) - bins = Attribute("bins", - "semi-colon separated list of binary files to be uploaded " - "to ${BIN} directory. " - "Binaries are globally available for all experiments unless " - "cleanHome is set to True (This will delete all files). ", - flags = Flags.Design) - code = Attribute("code", - "Plain text source code to be uploaded to the ${APP_HOME} directory. ", - flags = Flags.Design) - build = Attribute("build", - "Build commands to execute after deploying the sources. " - "Sources are uploaded to the ${SRC} directory and code " - "is uploaded to the ${APP_HOME} directory. \n" - "Usage example: tar xzf ${SRC}/my-app.tgz && cd my-app && " - "./configure && make && make clean.\n" - "Make sure to make the build commands return with a nonzero exit " - "code on error.", - flags = Flags.Design) - install = Attribute("install", - "Commands to transfer built files to their final destinations. " - "Install commands are executed after build commands. ", - flags = Flags.Design) - stdin = Attribute("stdin", "Standard input for the 'command'", - flags = Flags.Design) - tear_down = Attribute("tearDown", "Command to be executed just before " - "releasing the resource", - flags = Flags.Design) - - cls._register_attribute(command) - cls._register_attribute(forward_x11) - cls._register_attribute(env) - cls._register_attribute(sudo) - cls._register_attribute(depends) - cls._register_attribute(sources) - cls._register_attribute(code) - cls._register_attribute(files) - cls._register_attribute(bins) - cls._register_attribute(libs) - cls._register_attribute(build) - cls._register_attribute(install) - cls._register_attribute(stdin) - cls._register_attribute(tear_down) + cls._register_attribute( + Attribute("command", "Command to execute at application start. " + "Note that commands will be executed in the ${RUN_HOME} directory, " + "make sure to take this into account when using relative paths. ", + flags = Flags.Design)) + cls._register_attribute( + Attribute("forwardX11", + "Enables X11 forwarding for SSH connections", + flags = Flags.Design)) + cls._register_attribute( + Attribute("env", + "Environment variables string for command execution", + flags = Flags.Design)) + cls._register_attribute( + Attribute("sudo", + "Run with root privileges", + flags = Flags.Design)) + cls._register_attribute( + Attribute("depends", + "Space-separated list of packages required to run the application", + flags = Flags.Design)) + cls._register_attribute( + Attribute("sources", + "semi-colon separated list of regular files to be uploaded to ${SRC} " + "directory prior to building. Archives won't be expanded automatically. " + "Sources are globally available for all experiments unless " + "cleanHome is set to True (This will delete all sources). ", + flags = Flags.Design)) + cls._register_attribute( + Attribute("files", + "semi-colon separated list of regular miscellaneous files to be uploaded " + "to ${SHARE} directory. " + "Files are globally available for all experiments unless " + "cleanHome is set to True (This will delete all files). ", + flags = Flags.Design)) + cls._register_attribute( + Attribute("libs", + "semi-colon separated list of libraries (e.g. .so files) to be uploaded " + "to ${LIB} directory. " + "Libraries are globally available for all experiments unless " + "cleanHome is set to True (This will delete all files). ", + flags = Flags.Design)) + cls._register_attribute( + Attribute("bins", + "semi-colon separated list of binary files to be uploaded " + "to ${BIN} directory. " + "Binaries are globally available for all experiments unless " + "cleanHome is set to True (This will delete all files). ", + flags = Flags.Design)) + cls._register_attribute( + Attribute("code", + "Plain text source code to be uploaded to the ${APP_HOME} directory. ", + flags = Flags.Design)) + cls._register_attribute( + Attribute("build", + "Build commands to execute after deploying the sources. " + "Sources are uploaded to the ${SRC} directory and code " + "is uploaded to the ${APP_HOME} directory. \n" + "Usage example: tar xzf ${SRC}/my-app.tgz && cd my-app && " + "./configure && make && make clean.\n" + "Make sure to make the build commands return with a nonzero exit " + "code on error.", + flags = Flags.Design)) + cls._register_attribute( + Attribute("install", + "Commands to transfer built files to their final destinations. " + "Install commands are executed after build commands. ", + flags = Flags.Design)) + cls._register_attribute( + Attribute("stdin", "Standard input for the 'command'", + flags = Flags.Design)) + cls._register_attribute( + Attribute("tearDown", "Command to be executed just before " + "releasing the resource", + flags = Flags.Design)) @classmethod def _register_traces(cls): @@ -467,7 +469,7 @@ class LinuxApplication(ResourceManager): self.info("Uploading code") dst = os.path.join(self.app_home, "code") - self.node.upload(code, dst, overwrite = False, text = True) + self.node.upload(code, dst, overwrite = False, text = True, executable = True) def upload_stdin(self, stdin = None): if not stdin: