GithubHelp home page GithubHelp logo

rmetcalf9 / dockjob Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 8.0 7.87 MB

Job scheduler designed for use in a docker container.

License: MIT License

Shell 5.47% Python 66.34% JavaScript 6.72% Vue 20.56% HTML 0.22% Dockerfile 0.55% SCSS 0.16%

dockjob's People

Contributors

dependabot[bot] avatar rmetcalf9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dockjob's Issues

Embed version info into frontend during build process

It is possible for the browser to keep a cached version of the frontend application even though a newer backend is being run.
If as part of the container build process the version number was embedded into the webfrontend as a javascript constant the versions could be compared and a warning displayed to the user if the versions mismatch

Add quote around eval in script

Currently parameters with spaces don't work because I added an eval in.
I think adding a quote around the eval will fix this.

Update app/README.md to include more detail

Needs to add sudo in front of the continuous test example
Needs to explain how to use run_app_developer whilst developing
Needs to explain how to inject test jobs into a running instance
Needs to explain how to run the quasar frontend to test the application

API URLs not consistent

Some APIURL params are supplied without a trailing slash and others require a trailing slash.
Change these so they are consistent.

Bug in docker container

When I have a scheduled task I get this error:

127.0.0.1 - - [09/Apr/2018 16:17:33] "GET /frontend/index.html HTTP/1.1" 200 -
10.0.0.28 - - [09/Apr/2018 16:17:35] "POST /api/jobs/bed06152-a2c9-40bf-a81e-5ac0cd5809a3/execution HTTP/1.1" 200 -
Executing (Execution name = ddsa)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/app/JobExecutor.py", line 232, in run
self.loopIteration(curDatetime)
File "/app/JobExecutor.py", line 217, in loopIteration
if from_iso8601(self.JobExecutions[curJobExecution].dateCompleted) < timeToPurgeBefore:
File "/usr/lib/python3.6/site-packages/baseapp_for_restapi_backend_with_swagger/utils.py", line 11, in from_iso8601
raise Exception('Error - Only conversion of utc times from iso8601 is supported')
Exception: Error - Only conversion of utc times from iso8601 is supported

Add Basic Auth feature to image

Reconfigure sample compose file to configure kong to apply basic auth.
Get the basic Auth feature working. If basic auth is present app should show a login screen and use these credentials to access the service.

Add field based filtering

Currently filtering is just a text search.
I would like to be able to filter on a particular field.
One use case is to search for failing jobs with ResultCode<>0

Create sample compose file

Create a compose file which will host the image and put it behind a Kong API gateway.
At this stage with no auth

Make it possible to supply the user host part of url as a docker secret.

Dockjob needs to supply the user with endpoint url's as it is required by linking between the webapp, the API and the apidocs.

When embedding dockjob into a compose file the user endpoint URL's can be supplied but docker compose has no concept of variables so it is not possible to make a compose file that will work for both developers who are exposing the app via different URL's.

To get around this docker compose can be used to supply a config/secret option. This will generate a particular file in a directory with the config/secret value. I will make it possible to specify a DOCKRUN_USERHOSTFILE environment variable. If this variable is set the docker batch script will create an environment variable DOCKERRUN_USERHOST. It will then go through all environment variables starting with APIAPP_ and will evaluate them.

This will allow the compse file to contain something like the following:

    secrets:
     - userhostfilesecret
    environment:
      - DOCKERRUN_USERHOSTFILE=/run/secrets/userhostfilesecret
      - APIAPP_APIURL=https://${DOCKERRUN_USERHOST}:5443/dockjobapi
      - APIAPP_APIDOCSURL=https://${DOCKERRUN_USERHOST}:5443/dockjobapidocs/
      - "APIAPP_APIACCESSSECURITY=[{\"type\": \"basic-auth-login-toget-jwttoken\", \"loginurl\": \"https://${DOCKERRUN_USERHOST}:5443/login/\", \"cookiename\": \"jwt-auth-cookie\" }]"

Note: I am not sure if a leading \ will be required before the $

The secret file has the host name but not the port. I have thought about repeating this for the port but I don't think it makes sense for my use case at the moment.

JWT Logout

When using a JWT endpoint we currently just clear the token when we want to logout.

Instead we should send the service a logout call and have the token deleted from the backend so it can't be used. This would be more secure in case it is intercepted.

Once the login service implements this rmetcalf9/kong_ldap_login_endpoint#12 we should alter this code to support it.

Alter Python App so CORS response is optional

dockJob/app/src/app.py

Lines 7 to 12 in 39e0831

@app.after_request
def after_request(response):
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
response.headers.add('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS')
return response

For development the headers are always present.
We need a way where these are removed in production

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.