RUBi-ZA / JMS

A workflow management system and web-based cluster front-end for high performance computing
GNU General Public License v2.0
20 stars 15 forks source link

always encountered with "job not found"! #4

Open sampp opened 6 years ago

sampp commented 6 years ago

in JMS installation I always encountered with "job not found"! after installing Torque, NFS, and MySQL in ubuntu I have found in pip install -r requirements.txt these packages should be installed:

apt-get install libmysqlclient-dev
apt-get install libxml2-dev libxslt1-dev
apt-get install libmemcached-dev

also after successfully downloading all dependencies, I have my settings.py as following:

# Django settings for JMS project.
import os

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_email@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'JMS',                      # Or path to database file if using sqlite3.
        # The following settings are not used with sqlite3:
        'USER': 'jms',
        'PASSWORD': 'my_password',
        'HOST': 'localhost',      
        'PORT': '',                      # Set to empty string for default.
    }
}

# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
#ALLOWED_HOSTS = ['*']

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'Asia/Tehran'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = False

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = '/srv/JMS/media'

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = '/media/'

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = '/static/'

# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/assets/'

BASE = '/srv/JMS/'
# Additional locations of static files
STATICFILES_DIRS = (
    os.path.join(BASE, "static"),  
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = '4ibn4o6g2r(9y8)tk52uc3-$g26a_jf2vc)gzqb)l^kaz&p8&g'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    # Uncomment the next line for simple clickjacking protection:
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'JMS.urls'
#APPEND_SLASH = True

# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'JMS.wsgi.application'

TEMPLATE_DIRS = ('/srv/JMS/templates',
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    #REST framework apps
    'rest_framework',
    #'rest_framework_swagger',
    #my apps
    'users',
    'interface',
    'job',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)

SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
    'rest_framework.authentication.SessionAuthentication',
    ),
    'DEFAULT_RENDERER_CLASSES': (
    'rest_framework.renderers.JSONRenderer',
    )
}

SWAGGER_SETTINGS = {
    "exclude_namespaces": ['internal_urls'],
}

AUTHENTICATION_BACKENDS = (
    "users.backends.LinuxBackend",
)

AUTH_PROFILE_MODULE = 'users.UserProfile'

JMS_SETTINGS = {
    "JMS_shared_directory": "/NFS/JMS/",
    "resource_manager": {
        "name": "torque",
        "log_file": os.path.join(BASE, "logs/torque.log")
    }
}

BASE_DIR = '/srv/JMS/src' 
IMPERSONATOR_SETTINGS = {
    "key": os.path.join(BASE_DIR, "impersonator/pub.key"),
    "url": "127.0.0.1:8123"
}

after all when I try python manage.py migrate these errors stop everything:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/srv/JMS/src/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/srv/JMS/src/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/srv/JMS/src/venv/local/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/srv/JMS/src/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/srv/JMS/src/venv/local/lib/python2.7/site-packages/django/apps/config.py", line 87, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named job

I have tried in Ubuntu 14.0.4 and CentOS 7 many times, but always I have this problem, may you tell me where is my mistake? Thanks for your help.

sampp commented 6 years ago

in file settings.py I have changed job to jobs

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    #REST framework apps
    'rest_framework',
    #'rest_framework_swagger',
    #my apps
    'users',
    'interface',
    'jobs',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)

and I changed line 4 of jobs/management/commands/setup.py to: from jobs.models import Condition, Status, ParameterType everything has been done successfully but theres still a problem with filemanager when I deploy JMS the browser shows these error:

Request Method: | GET
-- | --
http://192.168.26.131:8000/JMS
1.7.1
KeyError
'filemanager'
/srv/JMS/src/filemanager/views.py in <module>, line 24
/srv/JMS/src/venv/bin/python
2.7.6
['/srv/JMS/src',  '/srv/JMS/src/venv/lib/python2.7',  '/srv/JMS/src/venv/lib/python2.7/plat-i386-linux-gnu',  '/srv/JMS/src/venv/lib/python2.7/lib-tk',  '/srv/JMS/src/venv/lib/python2.7/lib-old',  '/srv/JMS/src/venv/lib/python2.7/lib-dynload',  '/usr/lib/python2.7',  '/usr/lib/python2.7/plat-i386-linux-gnu',  '/usr/lib/python2.7/lib-tk',  '/srv/JMS/src/venv/local/lib/python2.7/site-packages',  '/srv/JMS/src/venv/lib/python2.7/site-packages']
Fri, 8 Jun 2018 06:56:07 +0430

I don't know how can I fix it

davidbrownza commented 6 years ago

Hi,

We have a fixes for the issues you have encountered on a new branch: 2.x-beta

Please try pulling this branch and follow the instructions in the updated README to install JMS. There are still some known issues when running workflows and the job history page is still being reworked, but other than that you should have a better experience with this branch.

Thanks, David