Git Product home page Git Product logo

ews_dev_env's Introduction

EWS Developpement installation

How to get on this branch:

#!/bin/bash
echo "# ews_dev_env" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/ffarella/ews_dev_env.git
git push -u origin master

This document guides you for setting up a new python/R/julia environnement do be deployed on Docker. Paragraphs are separated by a blank line.

Folder architecture

  • EWS/ (env.var. EWS_BASE_DIR)
    • installers/ (env.var. EWS_INST_DIR)

      This will contain all the necessary installation files to setup an new environnement.

      At the moment (2018-08-24): Files are located under X:\ews_dev_env:

    • bin/ (env.var. EWS_BIN_DIR)

      This will contain all the program executables.

      At the moment (2018-08-24):

      • Docker/ (Location of Docker installation)
      • GoogleChromePortable/ (Location of Google Chrome installation)
      • miniconda2/ (Location of Python installation)
      • VSCode/ (Location of Visual Studio Code installation)
      • postgresql-9.6.9/ (Location of PostgreSQL installation)
      • PgAdminPortable/ (Location of administrator tool for PostgreSQL)
      • wget/
    • scripts/ (env.var. EWS_SCRIPTS_DIR)

      This will contain all the scripts necessary to launch the relevant assets.

      At the moment (2018-08-24):

      • start_chome.cmd (start Google Chrome)
      • start_code_py27.cmd (start Visual Studio Code using Python 2.7 environnement)
      • start_code_py36.cmd (start Visual Studio Code using Python 3.6 environnement)
      • start_conda_env.cmd (set env. var. for Python/Conda)
      • start_conda_env_py27.cmd (set env. var. for Python 2.7)
      • start_conda_env_py36.cmd (set env. var. for Python 3.6)
      • start_docker_bash_shell.cmd (start Docker aware bash shell)
      • start_docker_powershell.cmd (start Docker aware powershell)
      • start_docker_shell.cmd (start Docker aware windows shell)
      • start_docker_env.cmd (set env. var. for Docker and start the machine)
      • start_ews_env.cmd (set env. var. for the EWS developement BASE SCRIPT)
      • start_jupyter_py27_F (start Jupyter notebook using Python 2.7 environnement on F: )
      • start_jupyter_py27_F (start Jupyter notebook using Python 3.6 environnement on F: )
      • start_jupyterlab_py27_F.cmd (start Jupyter lab using Python 2.7 environnement on F: )
      • start_jupyterlab_py27_F.cmd (start Jupyter lab using Python 3.6 environnement on F: )
      • start_postgresql_env.cmd (set env. var. for PostgreSQL)
    • configuration/ (env.var. EWS_CONFIG_DIR)

      At the moment (2018-08-24):

      • code (Configuration files for Visual Studio Code)
      • code_extensions (Extension files for Visual Studio Code)
      • jupyter (Configuration files for jupyter)
      • code_settings.json (Prefered settings for Visual Studio Code)
    • shortcuts/ (env.var. EWS_SHORTCUTS_DIR))

      At the moment (2018-08-24):

      • Code (python2.7) (Launcher for Visual Studio Code using Python 2.7 environnement)
      • Code (python3.6) (Launcher for Visual Studio Code using Python 3.6 environnement)
      • Docker_bash_shell (Launcher for Docker aware console)
      • Docker_powershell (Launcher for Docker aware console)
      • jupyter_py27_F (Launcher for Jupyter notebook using Python 2.7 environnement on F: )
      • jupyter_py36_F (Launcher for Jupyter notebook using Python 3.6 environnement on F: )
      • jupyterlab_py27_F (Launcher for Jupyter lab using Python 2.7 environnement on F: )
      • jupyterlab_py36_F (Launcher for Jupyter lab using Python 3.6 environnement on F: )
      • Docker_shell (Launcher for Docker aware console)
      • Google Chome (Launcher for Google Chome)
      • pgAdmin (Launcher for PostgreSQL Admin GUI)
      • psql (Launcher for PostgreSQL console)
      • python_conda (Launcher for Conda aware console)
      • python27 (Launcher for Python 2.7 environnement aware console)
      • python36 (Launcher for Python 3.6 environnement aware console)

Installation steps

  1. Python installation
    • Run Miniconda2-4.5.4-Windows-x86_64.exe
      • Select: Installation type: Just me
      • Select: Destination folder: C:\EWS\bin\miniconda2
      • Select nothing in Advanced options
  2. Docker installation
    • Run docker-toolbox-portable-win32-18.06.0-4-setup.exe
      • Select: Destination folder: C:\EWS\bin\Docker
    • Run start_docker_env.cmd to create the docker-machine
  3. Visual Studio Code installation
    • Install VSCodeUserSetup-x64-1.26.1.exe
      • Select: Installation type: Just me
      • Select: Destination folder: C:\EWS\bin\VSCode
      • Select nothing in Advanced options
    • Run scripts/install_vscode_extensions.cmd to download the necessary extensions
  4. PostgreSQL
    • Unpack postgis-bundle-pg96-2.4.4x32.zip.zip under postgresql-9.6.9
    • Unpack postgis-bundle-pg96-2.4.4x32.zip.zip under postgresql-9.6.9 (merge the folders)
    • Run %EWS_SCRIPTS_DIR%/postgresql/server_first_run.cmd to create the database

Docker images build

  1. Open VSCode and open a terminal.
  2. Type bash
  3. Type echo $MACHINE_NAME is $(docker-machine status $MACHINE_NAME). You should see:

    ewsdocker is Running

  4. Go in: cd $EWS_INST_DIR/docker_images/
  5. You can build all images by running: ./build_all.sh

Python build

See local_deployement

ews_dev_env's People

Contributors

ews-ffarella avatar

ews_dev_env's Issues

TypeError: Object of type 'PetSchema' is not JSON serializable

Hi,
First of all, thank you so much for this awesome extension! It really fullfills what I need.
I am just facing a little problem. At first i thought it was because i was using a application factory, but then i tried this simple code and I could not generate the openapi.json.
It throws the error TypeError: Object of type 'PetSchema' is not JSON serializable.
It sources back to

File "/flask_app/ext/flask_rest_api/spec/__init__.py", line 78, in _openapi_json
 def _openapi_json(self):
        """Serve JSON spec file"""
        # We don't use Flask.jsonify here as it would sort the keys
        # alphabetically while we want to preserve the order.
        return current_app.response_class(
            json.dumps(self.to_dict(), indent=2),
            mimetype='application/json')

Basically json.dumps fails because it is passed the Marshmallow schema.
Could you please tell me what I do wrong?
Merci beaucoup !!!

app.py:

import marshmallow as ma
from flask import Flask
from flask.views import MethodView

from flask_rest_api import Api, Blueprint

from .config import Config

app = Flask('My API')
app.config.from_object(Config)
api = Api(app)

class Pet:
    pass

api.definition('Pet')


class PetSchema(ma.Schema):

    class Meta:
        strict = True
        ordered = True

    id = ma.fields.Int(dump_only=True)
    name = ma.fields.String()


class PetQueryArgsSchema(ma.Schema):

    class Meta:
        strict = True
        ordered = True

    name = ma.fields.String()


blp = Blueprint(
    'pets', 'pets', url_prefix='/pets',
    description='Operations on pets'
)


@blp.route('/')
class Pets(MethodView):

    @blp.arguments(PetQueryArgsSchema, location='query')
    @blp.response(PetSchema(many=True))
    def get(self, args):
        """List pets"""
        return Pet.get(filters=args)


api.register_blueprint(blp)

config.py

API_VERSION = '1.0.0'
OPENAPI_VERSION = '3.0.0'
OPENAPI_URL_PREFIX = "/apidoc/"
OPENAPI_JSON_PATH = 'openapi.json'
OPENAPI_SWAGGER_UI_PATH = "swagger-ui"
OPENAPI_SWAGGER_UI_VERSION = '3.18.2'

requirements.txt

Flask==1.0.2
flask-rest-api==0.7.0
apispec==0.39.0
itsdangerous==0.24
Jinja2==2.10
MarkupSafe==1.0
marshmallow==2.15.4
PyYAML==3.13
webargs==4.0.0
Werkzeug==0.14.1

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.