Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harvest Log Status Pages #707

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
152430f
Creation of harvest log API
Oludare96 May 31, 2017
1603c6e
harvestlogs view file
Oludare96 May 31, 2017
e68a541
Creating new endpoint for Source Config
Oludare96 Jun 6, 2017
21e06a9
fix atempt
Oludare96 Jun 6, 2017
7d9fd3b
Creation of harvest log API
Oludare96 May 31, 2017
4360e2a
harvestlogs view file
Oludare96 May 31, 2017
29f6ad1
Creating new endpoint for Source Config
Oludare96 Jun 6, 2017
9af7821
fix atempt
Oludare96 Jun 6, 2017
8f35eb3
no message
Oludare96 Jun 9, 2017
9fa4245
fixing source config
cardene Jun 6, 2017
d7320cf
no message
cardene Jun 6, 2017
8055dbc
no message
Oludare96 Jun 9, 2017
7c54321
Checkout base.py
cardene Jun 14, 2017
162b977
display info from source config api on the harvest log page
cardene Jun 19, 2017
6b7ac4f
new backend filter for source config id's
cardene Jun 21, 2017
f61ea16
changes
Oludare96 Jun 21, 2017
7c174ce
Merge branch 'developesc' of https://github.com/cardene/SHARE into de…
Oludare96 Jun 21, 2017
e1182a9
no message
Oludare96 Jun 22, 2017
742c38f
[SHARE-924][Fix] Make RawDataJanitor actually feasible
chrisseto Jun 26, 2017
8f11199
[Fix] Correct harvester scheduling
chrisseto Jun 27, 2017
bd013f2
Update naming
chrisseto Jun 27, 2017
7727149
Finish renaming
chrisseto Jun 27, 2017
19e89b6
Merge branch 'hotfix/2.9.7' of https://github.com/CenterForOpenScienc…
Oludare96 Jul 5, 2017
72201bb
Merge branch 'develop' of https://github.com/CenterForOpenScience/SHA…
Oludare96 Jul 5, 2017
5292822
Merge branch 'develop' of https://github.com/CenterForOpenScience/SHA…
Oludare96 Jul 5, 2017
8de9437
Commit
Oludare96 Jul 5, 2017
3ba4447
Merge branch 'develop' of https://github.com/Oludare96/SHARE into dev…
Oludare96 Jul 5, 2017
c7bc03f
Max page size specification for source config endpoint
Oludare96 Jul 6, 2017
5a9a3e9
Merge branch 'develop' of https://github.com/CenterForOpenScience/SHA…
Oludare96 Jul 6, 2017
db24715
Merge branch 'develop' of https://github.com/Oludare96/SHARE into dev…
Oludare96 Jul 6, 2017
f6df317
Revert "Max page size specification for source config endpoint"
Oludare96 Jul 6, 2017
1ad0c14
Merge branch 'developOOO' of https://github.com/Oludare96/SHARE into …
Oludare96 Jul 6, 2017
84d569d
merging
cardene Jul 6, 2017
716373e
recentHarvest component
cardene Jul 17, 2017
546b6ec
commit
cardene Jul 19, 2017
d09273a
query for statuses
cardene Jul 19, 2017
d7d10ae
query for multiple parameters
cardene Jul 21, 2017
76a9ae1
return each hl per sc and and show fails first
cardene Jul 26, 2017
b30f9aa
working on sorting by health
cardene Jul 26, 2017
74f9804
working on sorting by health, issue with OuterRef(OuterRef('id'))
cardene Jul 27, 2017
41e5c29
commented out sort by health
cardene Aug 2, 2017
604f694
Merge branch 'develop' of https://github.com/CenterForOpenScience/SHA…
cardene Aug 8, 2017
c051d0d
no message
cardene Aug 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def count(self):
class FuzzyPageNumberPagination(PageNumberPagination):

django_paginator_class = FuzzyPaginator
max_page_size = 300


class CursorPagination(CursorPagination):
Expand Down
14 changes: 11 additions & 3 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from rest_framework_json_api import serializers

from share import models
from share.models import ProviderRegistration, SiteBanner, CeleryTaskResult

from api import fields
from share.models import ProviderRegistration, SiteBanner, CeleryTaskResult, logs

from api import fields

class BaseShareSerializer(serializers.ModelSerializer):

Expand Down Expand Up @@ -132,12 +132,20 @@ class Meta:
'is_active', 'gravatar', 'locale', 'time_zone', 'is_trusted'
)


class SourceSerializer(ShareModelSerializer):
class Meta:
model = models.Source
fields = ('name', 'home_page', 'long_title', 'icon')

class HarvestLogSerializer(ShareModelSerializer):
class Meta:
model = models.HarvestLog
fields = '__all__'

class SourceConfigSerializer(ShareModelSerializer):
class Meta:
model = models.SourceConfig
fields = '__all__'

class SiteBannerSerializer(ShareModelSerializer):
color = serializers.SerializerMethodField()
Expand Down
4 changes: 4 additions & 0 deletions api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from api.serializers import BaseShareSerializer
from api.views.share import ShareObjectViewSet



app_name = 'api'

router = DefaultRouter()
Expand Down Expand Up @@ -86,6 +88,8 @@ def register_url(self, subclass, viewset):
register_route(r'rawdata', views.RawDatumViewSet)
register_route(r'user', views.ShareUserViewSet)
register_route(r'sources', views.SourceViewSet)
register_route(r'HarvestLog', views.HarvestLogViewSet)
register_route(r'SourceConfig', views.SourceConfigViewSet)

router.register(r'normalizeddata', views.NormalizedDataViewSet, base_name='normalizeddata')

Expand Down
2 changes: 2 additions & 0 deletions api/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
from .registration import * # noqa
from .schema import * # noqa
from .banner import * # noqa
from .harvestlogs import * # noqa
from .sourceConfig import * # noqa
24 changes: 24 additions & 0 deletions api/views/harvestlogs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from rest_framework import viewsets
from rest_framework import filters
from django_filters.filters import MultipleChoiceFilter
from api.views import ShareObjectViewSet
from share.util import IDObfuscator

from api.serializers import HarvestLogSerializer
from share.models import HarvestLog

class SourceConfigFilterBackend(MultipleChoiceFilter):
def filter_queryset(self, request, queryset, view, conjoined=True):
if 'source_config_id' in request.GET:
decoded = IDObfuscator.decode_id(request.GET['source_config_id'])
queryset = queryset.filter(source_config_id=decoded)
if 'status' in request.GET:
queryset = queryset.filter(status__in=request.GET.getlist('status'))
return queryset
#return queryset.order_by('endDate')

class HarvestLogViewSet(ShareObjectViewSet):
serializer_class = HarvestLogSerializer
queryset = HarvestLog.objects.all()
filter_backends = (SourceConfigFilterBackend, )
filter_fields = ('status',)
1 change: 1 addition & 0 deletions api/views/share.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class ShareObjectViewSet(viewsets.ReadOnlyModelViewSet):

# Override get_queryset to handle items marked as deleted.
def get_queryset(self, list=True):
# import ipdb; ipdb.set_trace()
queryset = super().get_queryset()
if list and hasattr(queryset.model, 'is_deleted'):
return queryset.exclude(is_deleted=True)
Expand Down
33 changes: 33 additions & 0 deletions api/views/sourceConfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from rest_framework import viewsets
from api.views import ShareObjectViewSet
from rest_framework import filters
from api.serializers import SourceConfigSerializer
from share.models import SourceConfig
from api.pagination import FuzzyPageNumberPagination
from django.db.models import Count
from django.db.models import Aggregate
from share.models import HarvestLog
from django.db.models import OuterRef, Subquery
from django.db.models import IntegerField

class SourceConfigViewSet(ShareObjectViewSet):
serializer_class = SourceConfigSerializer
pagination_class = FuzzyPageNumberPagination
queryset = SourceConfig.objects.all()

# def get_queryset(self):
# recent_harvests = HarvestLog.objects.filter(
# source_config_id = OuterRef(OuterRef('id')),
# status__in = [HarvestLog.STATUS.failed, HarvestLog.STATUS.succeeded]
# ).order_by('-date_started')[:10]
# recent_fails = HarvestLog.objects.filter(
# status = HarvestLog.STATUS.failed,
# id__in = Subquery(recent_harvests.values('id')),
# # output_field = models.IntegerField())
# )
# queryset = SourceConfig.objects.all().annotate(
# fails=Count(Subquery(recent_fails.values('id')),
# # output_field = models.IntegerField()))
# )
# queryset = queryset.order_by('fails')
# return queryset
12 changes: 12 additions & 0 deletions bin/celery
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/Users/admin/SHARE/bin/python3.5
# EASY-INSTALL-ENTRY-SCRIPT: 'celery==4.0.2','console_scripts','celery'
__requires__ = 'celery==4.0.2'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('celery==4.0.2', 'console_scripts', 'celery')()
)
7 changes: 0 additions & 7 deletions bin/share

This file was deleted.

1 change: 1 addition & 0 deletions docs/elasticsearch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Elasticsearch can be used to search the following fields in the normalized data:
'contributors'
'funders'
'publishers'
'id'


Accessing the Search API
Expand Down
148 changes: 148 additions & 0 deletions include/site/python3.5/greenlet/greenlet.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
/* vim:set noet ts=8 sw=8 : */

/* Greenlet object interface */

#ifndef Py_GREENLETOBJECT_H
#define Py_GREENLETOBJECT_H

#include <Python.h>

#ifdef __cplusplus
extern "C" {
#endif

#define GREENLET_VERSION "0.4.12"

typedef struct _greenlet {
PyObject_HEAD
char* stack_start;
char* stack_stop;
char* stack_copy;
intptr_t stack_saved;
struct _greenlet* stack_prev;
struct _greenlet* parent;
PyObject* run_info;
struct _frame* top_frame;
int recursion_depth;
PyObject* weakreflist;
PyObject* exc_type;
PyObject* exc_value;
PyObject* exc_traceback;
PyObject* dict;
} PyGreenlet;

#define PyGreenlet_Check(op) PyObject_TypeCheck(op, &PyGreenlet_Type)
#define PyGreenlet_MAIN(op) (((PyGreenlet*)(op))->stack_stop == (char*) -1)
#define PyGreenlet_STARTED(op) (((PyGreenlet*)(op))->stack_stop != NULL)
#define PyGreenlet_ACTIVE(op) (((PyGreenlet*)(op))->stack_start != NULL)
#define PyGreenlet_GET_PARENT(op) (((PyGreenlet*)(op))->parent)

#if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 1) || PY_MAJOR_VERSION > 3
#define GREENLET_USE_PYCAPSULE
#endif

/* C API functions */

/* Total number of symbols that are exported */
#define PyGreenlet_API_pointers 8

#define PyGreenlet_Type_NUM 0
#define PyExc_GreenletError_NUM 1
#define PyExc_GreenletExit_NUM 2

#define PyGreenlet_New_NUM 3
#define PyGreenlet_GetCurrent_NUM 4
#define PyGreenlet_Throw_NUM 5
#define PyGreenlet_Switch_NUM 6
#define PyGreenlet_SetParent_NUM 7

#ifndef GREENLET_MODULE
/* This section is used by modules that uses the greenlet C API */
static void **_PyGreenlet_API = NULL;

#define PyGreenlet_Type (*(PyTypeObject *) _PyGreenlet_API[PyGreenlet_Type_NUM])

#define PyExc_GreenletError \
((PyObject *) _PyGreenlet_API[PyExc_GreenletError_NUM])

#define PyExc_GreenletExit \
((PyObject *) _PyGreenlet_API[PyExc_GreenletExit_NUM])

/*
* PyGreenlet_New(PyObject *args)
*
* greenlet.greenlet(run, parent=None)
*/
#define PyGreenlet_New \
(* (PyGreenlet * (*)(PyObject *run, PyGreenlet *parent)) \
_PyGreenlet_API[PyGreenlet_New_NUM])

/*
* PyGreenlet_GetCurrent(void)
*
* greenlet.getcurrent()
*/
#define PyGreenlet_GetCurrent \
(* (PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM])

/*
* PyGreenlet_Throw(
* PyGreenlet *greenlet,
* PyObject *typ,
* PyObject *val,
* PyObject *tb)
*
* g.throw(...)
*/
#define PyGreenlet_Throw \
(* (PyObject * (*) \
(PyGreenlet *self, PyObject *typ, PyObject *val, PyObject *tb)) \
_PyGreenlet_API[PyGreenlet_Throw_NUM])

/*
* PyGreenlet_Switch(PyGreenlet *greenlet, PyObject *args)
*
* g.switch(*args, **kwargs)
*/
#define PyGreenlet_Switch \
(* (PyObject * (*)(PyGreenlet *greenlet, PyObject *args, PyObject *kwargs)) \
_PyGreenlet_API[PyGreenlet_Switch_NUM])

/*
* PyGreenlet_SetParent(PyObject *greenlet, PyObject *new_parent)
*
* g.parent = new_parent
*/
#define PyGreenlet_SetParent \
(* (int (*)(PyGreenlet *greenlet, PyGreenlet *nparent)) \
_PyGreenlet_API[PyGreenlet_SetParent_NUM])

/* Macro that imports greenlet and initializes C API */
#ifdef GREENLET_USE_PYCAPSULE
#define PyGreenlet_Import() \
{ \
_PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \
}
#else
#define PyGreenlet_Import() \
{ \
PyObject *module = PyImport_ImportModule("greenlet"); \
if (module != NULL) { \
PyObject *c_api_object = PyObject_GetAttrString( \
module, "_C_API"); \
if (c_api_object != NULL && PyCObject_Check(c_api_object)) { \
_PyGreenlet_API = \
(void **) PyCObject_AsVoidPtr(c_api_object); \
Py_DECREF(c_api_object); \
} \
Py_DECREF(module); \
} \
}
#endif

#endif /* GREENLET_MODULE */

#ifdef __cplusplus
}
#endif
#endif /* !Py_GREENLETOBJECT_H */
1 change: 1 addition & 0 deletions pip-selfcheck.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"last_check":"2017-06-22T15:35:52Z","pypi_version":"9.0.1"}
3 changes: 3 additions & 0 deletions pyvenv.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
home = /usr/local/bin
include-system-site-packages = false
version = 3.5.3
3 changes: 3 additions & 0 deletions share/doc/networkx-1.11/INSTALL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
See doc/source/install.rst
or
http://networkx.github.io/documentation/latest/install.html
40 changes: 40 additions & 0 deletions share/doc/networkx-1.11/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
License
=======
NetworkX is distributed with the BSD license.

::

Copyright (C) 2004-2016, NetworkX Developers
Aric Hagberg <[email protected]>
Dan Schult <[email protected]>
Pieter Swart <[email protected]>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* Neither the name of the NetworkX Developers nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.


THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading