Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mundialis/actinia_core into grass79
Browse files Browse the repository at this point in the history
  • Loading branch information
mmacata committed Dec 22, 2020
2 parents 203f9f9 + fdc0d91 commit 3a767f8
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 18 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '33 6 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
7 changes: 2 additions & 5 deletions docker/actinia-core-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ LABEL maintainer="[email protected],[email protected],[email protected]
COPY . /src/actinia_core

WORKDIR /src/actinia_core
RUN git describe --dirty --tags --long --first-parent
RUN git checkout .
COPY requirements.txt requirements.txt
# scipy installs but wheel building fails. Helping packages were
# RUN add openblas openblas-dev lapack lapack-dev gfortran
RUN sed -i 's+scikit-learn+#scikit-learn+g' requirements.txt
RUN python3 setup.py sdist bdist_wheel -d /build
# RUN pip3 wheel -r requirements.txt -w /build
# RUN python3 -m pep517.build --out-dir /build . && \
# RUN python3 -m pep517.build --out-dir /build .


FROM mundialis/actinia-core:alpine-runtime-pkgs_v5 as actinia_installation
Expand Down
2 changes: 1 addition & 1 deletion docker/actinia-core-dev/actinia.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ log_file_format = colored
log_stderr_format = plain
log_fluent_host = fluentd
log_fluent_port = 24224
log_level = 4
log_level = 3

[MISC]
tmp_workdir = /actinia_core/workspace/tmp
Expand Down
8 changes: 4 additions & 4 deletions docker/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ services:
- ./actinia-core-data/grassdb:/actinia_core/grassdb:Z
- ./actinia-core-data/pgpass:/mnt/pgpass:Z
- ./actinia-core-data/geodata_dir:/mnt/geodata:Z
- ./actinia-core-data/userdata:/actinia_core/userdata"
- ./actinia-core-data/workspace/temp_db:/actinia_core/workspace/temp_db"
- ./actinia-core-data/workspace/tmp:/actinia_core/workspace/tmp"
- ./actinia-core-data/resources:/actinia_core/resources"
- ./actinia-core-data/userdata:/actinia_core/userdata
- ./actinia-core-data/workspace/temp_db:/actinia_core/workspace/temp_db
- ./actinia-core-data/workspace/tmp:/actinia_core/workspace/tmp
- ./actinia-core-data/resources:/actinia_core/resources
- ../.:/src/actinia_core/.
ports:
- "8088:8088"
Expand Down
2 changes: 1 addition & 1 deletion docker/grass_addons_list.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ i.segment.stats,
i.segment.uspo,
i.sentinel,
r.bioclim,
v.centerpoint,
r.change.info,
r.colors.out_sld,
r.gdd,
Expand All @@ -17,6 +16,7 @@ r.sample.category,
r.seasons,
r.series.lwr,
r.viewshed.cva,
v.centerpoint,
v.strds.stats,
v.surf.mass,
importer,https://github.com/mundialis/importer
Expand Down
3 changes: 2 additions & 1 deletion src/actinia_core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import os
from .endpoints import create_endpoints
from .health_check import health_check
from .version import version
from .version import version, init_versions
from .resources.common.app import flask_app
from .resources.common.config import global_config, DEFAULT_CONFIG_PATH
from .resources.common.redis_interface import connect, create_job_queues
Expand All @@ -48,6 +48,7 @@

# Create the endpoints based on the global config
create_endpoints()
init_versions()

# TODO: Implement a better error handler
#@flask_app.errorhandler(InvalidUsage)
Expand Down
42 changes: 36 additions & 6 deletions src/actinia_core/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,39 @@
__email__ = "[email protected]"

from flask import make_response, jsonify
from .resources.common.app import flask_app, API_VERSION, URL_PREFIX
import importlib
import subprocess
import sys

from .resources.common.app import flask_app, URL_PREFIX
from .resources.common.config import global_config
from .resources.common.logging_interface import log
from . import __version__


G_VERSION = {}
PLUGIN_VERSIONS = {}
PYTHON_VERSION = ""


def init_versions():
global PYTHON_VERSION

g_version = subprocess.run(
['grass', '--tmp-location', 'epsg:4326', '--exec',
'g.version', '-rge'], capture_output=True).stdout
log.debug('Detecting GRASS GIS version')
for i in g_version.decode('utf-8').strip('\n').split('\n'):
G_VERSION[i.split('=')[0]] = i.split('=')[1]

log.debug('Detecting Plugin versions')
for i in global_config.PLUGINS:
module = importlib.import_module(i)
PLUGIN_VERSIONS[i] = module.__version__

PYTHON_VERSION = sys.version.replace('\n', '- ')


# Return the version of Actinia Core as REST API call
@flask_app.route(URL_PREFIX + '/version')
def version():
Expand All @@ -45,10 +74,11 @@ def version():
Returns: Response
"""
info = {"version":__version__, "plugins":",".join(global_config.PLUGINS)}

if 'actinia_gdi' in global_config.PLUGINS:
from actinia_gdi import __version__ as actinia_gdi_version
info['plugin_versions'] = {'actinia_gdi': actinia_gdi_version}
info = {}
info['version'] = __version__
info['plugins'] = ",".join(global_config.PLUGINS)
info['grass_version'] = G_VERSION
info['plugin_versions'] = PLUGIN_VERSIONS
info['python_version'] = PYTHON_VERSION

return make_response(jsonify(info), 200)

0 comments on commit 3a767f8

Please sign in to comment.