Giter VIP home page Giter VIP logo

7574_tp2's Introduction

Reddit Meme Analyzer

This program analyzes the datasets available at kaggle and outputs the following three results

  • Posts Score Average
  • Memes liked by students
  • Download meme with best average sentiment

Datasets should be located at the datasets directory, the default expected names are complete-posts.csv and complete-comments.csv

The meme will be downloaded in the results directory

To run the program with docker simply run make docker-compose-up

The program allows the following customizations:

  • Student Nodes Replicas: The nodes that calculate student memes can have multiple replicas this is done via the STUDENT_MEME_CALCULATOR_REPLICAS environment variable that is both located at local.env and the docker-compose.yaml

  • Student Memes Repeat: The systems prints the URLs for the student memes. They might be duplicated. Allowing duplicates can be toggled by changing STUDENT_MEME_ALLOW_REPEATS in the docker compose

  • Input files and chunks: For both the posts and comments we can configure where the program should be looking for the files and how many lines in a single chunk. Variables: POSTS_FILE_PATH, POSTS_FILE_CHUNK, COMMENT_FILE_PATH, COMMENT_FILE_CHUNK. In case of changing the paths, the volumes should also be updated.

  • Meme Result: The path of where the meme will be downloaded and how many bytes per request are downloaded is also configurable MEME_RESULT_PATH, MEME_RESULT_BUFFER

7574_tp2's People

Contributors

aleperno avatar

Watchers

 avatar

7574_tp2's Issues

Limpieza Codigo

Hay muchos prints en el código utilizados a modo de debug (imprimiendo cosas como "hola", "recibí algo") que estaría bueno eliminar o "formalizar" más. También hay inconsistencia en los logs ya que hay varios en español y varios en inglés. Otro detalle más a tener en cuenta es la cantidad de código comentado que debería eliminarse para un release final.

Graceful Quit

No hay un Graceful Quit en los clientes, ya que sólo se lanza una excepción de SigTerm pero no se liberan recursos al catchearla.

Aviso Puppeteer

No se le informa al Puppeteer cuando los Puppets ya han recibido su ID, evitando así que cierre esas init queues.

Re-estructurar código

Los clientes (Posts, Comments y Results) están definidos en el init.py del package cuando por buenas prácticas sería mejor tenerlos definidos en archivos propios.

Checkeo Retry

No se chequea en todos los casos si el connect_retry devuelve una conexión válida o no, sólo se hace en los Puppet aunque debería ser un comportamiento compartido con otros nodos como los Clients y el Puppeteer.

Remover Asserts

Hay algunos assert en el código con los que hay que tener cuidado, ya que en caso de fallar la aserción el sistema rompería por un error. Estos casos sería mejor controlarlos manualmente y, en caso de detectar una falla, loguearla pero no hacer que el sistema se detenga.

Readme Instrucciones

Sería bueno contar con un README con instrucciones sobre cómo levantar y correr el sistema, para facilitar el análisis y la comprensión de un tercero que llegue al código.

Descarga meme

No se descargan los bytes del meme con mejor análisis de sentimient

Tipar Mensajes

Cuando a través de una misma queue llegan distintos tipos de mensajes, se utilizan criterios muy ad-hoc para saber si vienen de un flujo u otro (por ejemplo, el Sentiment Meme chequea si hay un atributo meme_url o comment). Esto no es recomendable ya que vuelve al sistema menos escalable, si se empieza a agregar dicho campo en el otro flujo va a empezar a romper y va a ser difícil darse cuenta porque fue. En estos casos, es mejor tipar el mensaje directamente con algún ID especial (¿P para Posts, C para comments?) que sabemos que nunca va a cambiar, para evitar posibles problemas futuros.

Eliminar Hardcodes

Algunas variables a lo largo del código (cómo los parámetros de delay, backoff y retries de la conexión con Rabbit) están hardcodeados en lugar de ser configurables. Estos deberían permitirse cargar dinámicamente o al menos setearse con variables definidas en algún archivo de properties.

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.