switch to logrus for logging.
replaced old logging library with a wrapper around logrus.
We now just need to use the exported Log(...) and Logf(...) from the logging/
package that wraps around a set of loggers constituting a chain (following COR).
Loggers are configured using a YAML file that specifies the following.
1. enabled/disabled
2. whether the message should be logged on console.
3. filename extension.
4. minimum log level.
Retrofitted source code to now use the updated logging library.
Updated the documentation with information regarding the specification
of the log config file.
Currently, the log format in the config file is not adhered to. This is going to be
addressed in a future commit.
Added a utility to help with validating structs. This utility accepts
validators and runs them. If any of the validators fail, then the
error is wrapped with a given base message and returned.
Added validators for checking different attributes of a task
definition.
Added test code to test task validators.
Retrofitted scheduler.go to just log the task validation error and
terminate. If task validation does not report any error, then the
tasks are provided to the scheduler and elektron registers itself
with Mesos.
refact imports to github.xxx. update go.mod + go.sum
* removed vendor/ folder
* Added vendor/ submodule.
Moved dependencies that need to be vendored into separate repository.
- https://github.com/spdfg/elektron-vendor
Added vendor/ as a submodule using the below command.
- git submodule add https://github.com/spdfg/elektron-vendor vendor
If wanting to use vendor, run the following commands after cloning
elektron.
1. git submodule init
2. git submodule update
* added instructions to clone vendor/ submodule.
* updated module to spdfg. Refactored imports
Added support for dependency management using go modules.
Note that Go version 1.11+ is required if using go modules for
dependency management.
Updated the gitlab CI yaml file to use go modules instead of copying
everything to GOPATH. Ran go mod download before running build script to
download all dependencies into cache.
Initialization of the logger happens after all the command-line
arguments are validated. So, in case any of the command-line
arguments were invalid, the log directory is not created.
Retrofitted the driver code and the scheduler builder to only use
the language provided 'log' package as elektron's logger will not
yet be initialized.
Taking pcp config file name (or path) from commandline.
In scheduler.go, also checking to see if provided pcp config file
exists. If not, then exitting.
Experimentation/schedPolicySwitcher
1. Initial commit for consolidated loggers using observer pattern.
2. class factory for schedulers.
3. Using the scheduling policy class factory in schedulers/store.go and the scheduler builder helpers in schedulers/helpers.go, feature to be able to be able to plug a scheduling policy of your choice from the command line (right now only first-fit and bin-packing are possible. Will be updating the class factory to include other scheduling policies as well.
4. Removed TODO for using generic task sorters. Modified TODO for a config file input to run electron.
5. Added other schedulers to the factory
6. Partially retrofitted the other scheduling policies to use the logging library.
7. Retrofitted extrema and progressive to use the consolidated logging library. Fixed parameter issue with s.base.Disconnected(). Formatted project
8. Move statusUpdate(...) into base.go to remove redundant code.
9. Converted the baseScheduler into a state machine where the state is a scheduling policy that defines an approach to consume resource offers.
10. Added another command line argument to be used to enable switching of scheduling policies. Retrofitted scheduling policies to switch only if the particular feature has been enabled.
changed argument to coLocated(...) to take base type rather than ElectronScheduler type. Also, prepended the prefix to the directory of the logs so that it would be easier to determine what the files in a directory correspond to without viewing the contents of the directory.
Defined methods in ElectronScheduler. Each of these methods corresponds to a type of log that an ElectronScheduler would make. Each of these methods would need to be implemented by the scheduling policy.
Electron has only one scheduler that implements the mesos scheduler interface. All the scheduling policies are just different implementations of ways to consume mesos resource offers. Retrofitted scheduling policies to now embed SchedPolicyState instead of baseScheduler.
Approved-by: Pradyumna Kaushik <pkaushi1@binghamton.edu>