Code Monkey home page Code Monkey logo

lab-bluemix-cf's People

Contributors

dependabot[bot] avatar iichikong avatar rofrano avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lab-bluemix-cf's Issues

Updates from SQL Alchemy may cause the build fail

Describe the problem
Discovered at the end of the January 2023, rebuilding the docker image then flask run will produce the following error:

AttributeError: module 'sqlalchemy' has no attribute 'all'

To Reproduce
Steps to reproduce the behavior:

  1. pull the repo
  2. open in container
  3. rebuild the container
  4. flask run
  5. see error

Screenshots
image

Additional context
I found the fix on stack overflow: https://stackoverflow.com/questions/75275563/attributeerror-module-sqlalchemy-has-no-attribute-all-in-github-actions
I think this error occurs because SQLAlchemy has made some updates. I fixed it locally by changing the corresponding Flask and SQLAlchemy version in my requirements.txt

My solution : I basically upgraded everything and it worked again, with some warnings. I think we can downgrade versions to make it compatible too? (didn't test it)

# Werkzeug keeps breaking Flask!
Werkzeug==2.2.2

# Runtime dependencies
Flask==2.2.2
Flask-SQLAlchemy==3.0.3

Outputs:
image

Convert to Flask-RESTful

As an Instructor
I need to teach my students several approaches to solving problems
So that they have a rich set of architectural blueprints to choose from

Assumptions:

  • REST API's are all about Resources
  • Flask-RESTful makes Resource a first class object
  • Convert the repo to use Flask-RESTful as an example of how to refactor the code

Acceptance Criteria:

Given we have a project that uses traditional Flask
When I convert it to use Flask-RESTful
Then students will have another way of structuring their REST API microservices

[Bug Report] Missing `wget` when using docker as provider

When using Docker as the Vagrant provider, there will be an error during Installing IBM Cloud CLI

at wget -O bluemix-cli.tar.gz https://clis.cloud.ibm.com/download/bluemix-cli/1.4.0/linux64

    default: ************************************
    default:  Installing IBM Cloud CLI...
    default: ************************************
    default:
    default: sh: 2: wget: not found

Seems like the rofrano/vagrant-provider:debian image lacks wget.

Adding wget at the end of

apt-get install -y git vim tree python3 python3-pip python3-venv

in Vagrantfile solves this problem.

Or simply change the docker image to rofrano/vagrant-provider:ubuntu also works.

Change from Redis to Cloudant NoSQL database

As an Instructor
I need to use Cloud resources that are free for my students
So that they don't incur any expenses to take my class

Assumptions:

  • IBM Cloud no longer supports free Redis databases so I need to change the example to use another free database. Unfortunately, the only two free databases are Cloudant and DB2 and since this is a NoSQL example, the only choice is Cloudant.
  • Because we use Docker images for middleware, and the IBM Cloudant image is a wapping 1.7GB in size, we will develop with CouchDB which is only 252MB and quicker for students to download.

Acceptance Criteria:

When I deploy my application into IBM Cloud
Then I can connect to a NoSQL database in the cloud
And that database must be free of charges

Update method doesn't preserve id

The update method doesn't set the id after it pulls in the new data from the payload. It should reset the id to match the id on the URL.

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.