{"id":18964186,"url":"https://github.com/janeliascicomp/java-lsf","last_synced_at":"2025-07-14T02:37:41.996Z","repository":{"id":52545449,"uuid":"97280219","full_name":"JaneliaSciComp/java-lsf","owner":"JaneliaSciComp","description":"Java API to IBM Platform LSF","archived":false,"fork":false,"pushed_at":"2023-12-12T00:29:47.000Z","size":171,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-19T16:51:38.708Z","etag":null,"topics":["cluster","hpc","janelia","lsf"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaneliaSciComp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-14T23:42:15.000Z","updated_at":"2023-01-12T09:15:44.000Z","dependencies_parsed_at":"2024-11-08T14:24:03.180Z","dependency_job_id":"8078c15d-ebf2-4dbe-927f-73fe78efdb8c","html_url":"https://github.com/JaneliaSciComp/java-lsf","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/JaneliaSciComp/java-lsf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaneliaSciComp%2Fjava-lsf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaneliaSciComp%2Fjava-lsf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaneliaSciComp%2Fjava-lsf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaneliaSciComp%2Fjava-lsf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaneliaSciComp","download_url":"https://codeload.github.com/JaneliaSciComp/java-lsf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaneliaSciComp%2Fjava-lsf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265233753,"owners_count":23731825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cluster","hpc","janelia","lsf"],"created_at":"2024-11-08T14:23:12.792Z","updated_at":"2025-07-14T02:37:41.973Z","avatar_url":"https://github.com/JaneliaSciComp.png","language":"Java","readme":"# Java API to LSF\n\n![CI Build](https://github.com/JaneliaSciComp/java-lsf/actions/workflows/maven.yml/badge.svg)\n\nThis is a simple wrapper library for using [IBM Platform LSF](https://en.wikipedia.org/wiki/Platform_LSF) from Java via command-line utilities such as bsub and bjobs. It is intended to be as simple an interface as possible, without the added complexity of DRMAA or the LSF APIs.\n\nThe job management piece is abstracted in such a way that it could be extended for use with other job schedulers, or other job scheduler APIs, but currently LSF command line is the only implementation.\n\n## Building\n\nThis project builds easily with Maven. For example:\n```\n$ mvn package\n```\n\n## Deploying to Janelia repo\nTo deploy to Janelia nexus repository create a settings xml file like the one \nbelow:\n```\n\u003csettings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\"\n          xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n          xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd\"\u003e\n\n   \u003cservers\u003e\n      \u003cserver\u003e\n         \u003cid\u003ejanelia-releases\u003c/id\u003e\n         \u003cusername\u003eyourusername\u003c/username\u003e\n         \u003cpassword\u003eyourpassword\u003c/password\u003e\n      \u003c/server\u003e\n   \u003c/servers\u003e\n\n\u003c/settings\u003e\n```\nand then you can run. \n```\nmvn -s \u003cpath_to_my_deploy_settings_xml\u003e deploy\n```\nYou can also add the server to your default settings.xml.\n\n## Concepts\n\nThe API contains of a generic job monitoring application (`org.janelia.cluster`) and an LSF implementation (`org.janelia.cluster.lsf`). Most of the concepts are taken directly from DRMAA:\n\n* Job - job running on a remote cluster (sometimes this term can also encompass job arrays)\n* Job Array - a job template that's been parameterized to run one or more times with different inputs\n* Job Template - the specification for a job or job array. This is what gets submitted to the cluster scheduler.\n* Job Status - status of the job on the cluster\n* Job Info - a snapshot of a job's status and other metadata at a certain point in time.\n\n## Usage\n\nSimply instantiate `org.janelia.cluster.JobManager` and call `start()`. It will keep track of all jobs submitted to the cluster, and complete futures when they are ready. For example:\n\n```java\nJobSyncApi api = new LsfSyncApi();\nJobManager mgr = new JobManager(api);\nJobMonitor monitor = new JobMonitor(mgr);\nmonitor.start();\n\nJobTemplate jt = new JobTemplate();\njt.setRemoteCommand(\"bash\");\njt.setArgs(Arrays.asList(scriptPath));\njt.setJobName(\"test\");\njt.setInputPath(inputDirPath+\"/input.#\");\njt.setOutputPath(outputDirPath+\"/out.#\");\njt.setErrorPath(outputDirPath+\"/err.#\");\njt.setNativeSpecification(Arrays.asList(\"-W 1\", \"-n 2\"));\n\nfinal JobFuture future = mgr.submitJob(jt);\n\nfuture.whenCompleteAsync(new BiConsumer\u003cCollection\u003cJobInfo\u003e, Throwable\u003e() {\n    @Override\n    public void accept(Collection\u003cJobInfo\u003e infos, Throwable t) {\n        if (t!=null) {\n            log.error(\"Error running job\", t);\n        }\n        log.info(\"Job has completed: \"+infos);\n    }\n});\n```\n\nAlternatively, you can omit the JobMonitor and periodically call `checkJobs()` manually. This is useful when running in managed environments such as an application server, which have their own internal periodic job scheduling.\n\nIf you'd like to check the status of a specific job without spinning up a background thread, you can call `JobSyncApi::getJobInfo` like this:\n```java\nJobSyncApi api = new LsfSyncApi();\n\nList\u003cJobInfo\u003e jobs = api.getJobInfo();\nMultimap\u003cLong, JobInfo\u003e jobMap = Utils.getJobMap(jobs);\n// infos will contain one object for every job running on the grid with the given jobId\nList\u003cJobInfo\u003e infos = jobMap.get(jobId);\n```\n\nFor more usage example, see the unit tests, in particular `org.janelia.cluster.lsf.LsfTests`.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaneliascicomp%2Fjava-lsf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaneliascicomp%2Fjava-lsf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaneliascicomp%2Fjava-lsf/lists"}