-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dependency installer service and enhance task runner with d…
…ependency management - Introduced a new DependencyInstallerService interface to define methods for managing dependency installation commands. - Implemented registry service for managing the DependencyInstallerService instance. - Enhanced the task runner to install dependencies if available, including command execution and logging for stdout and stderr. - Improved error handling and logging throughout the task runner's dependency installation process. - Updated the runner's methods to utilize the new dependency management features, ensuring better integration and functionality.
- Loading branch information
Showing
3 changed files
with
168 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package dependency | ||
|
||
import ( | ||
"github.com/crawlab-team/crawlab/core/interfaces" | ||
) | ||
|
||
var serviceInstance interfaces.DependencyInstallerService | ||
|
||
func SetDependencyInstallerRegistryService(svc interfaces.DependencyInstallerService) { | ||
serviceInstance = svc | ||
} | ||
|
||
func GetDependencyInstallerRegistryService() interfaces.DependencyInstallerService { | ||
return serviceInstance | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package interfaces | ||
|
||
import ( | ||
"go.mongodb.org/mongo-driver/bson/primitive" | ||
"os/exec" | ||
) | ||
|
||
type DependencyInstallerService interface { | ||
GetInstallDependencyRequirementsCmdBySpiderId(id primitive.ObjectID) (cmd *exec.Cmd, err error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters