Comments (10)
@Naramsim I'm glad you've suggested that! I had a bit of a read into Compose today but it looked too complicated for me to understand at first, so to start development on this I just installed PG and manually linked the containers together. It was a challenge to get the PHP PG extension installed but I got there in the end!
If you could help with the docker-compose.yml
that would be fantastic. I would prefer Apache for now but maybe we can move to nginx later - I know it's faster but just trying to manage how much I take on that I haven't used before ;)
from slackemon.
I would not stick with alpine-linux, and installing php/apache/postgre on it.
I would prefer use three containers that are based on Alpine. That are
So, in the end, we would have a system composed by three small (and secure) containers, which are started automatically with the command docker-compose up -d
What do you think?
from slackemon.
I'm currently working on implementing Postgres as an option for the data store, using docker postgres for dev and intending to use the free hobby plan of Postgres on Heroku for prod (allows up to 10k rows).
Redis is another potential option but is only free on Heroku without data persistence, so that's on the backburner for now.
10k row limit for free Heroku prod should be fine providing we can handle large JSON strings - in the current structure, that's 1 per player, and 1 each per spawn instance and battle instance both of which can be pruned.
from slackemon.
Hey, @tdmalone, I see the project is expanding 😄
Maybe it's time to create a docker-compose.yml
. Basically, it is a file processed by Docker Compose (on Linux it is not shipped with Docker) which creates several containers at the same time and orchestrate them. So we could split the project into the following images/containers:
- Apache2 / Nginx (you choose)
- Php7
- PostgreSQL
from slackemon.
(We could even look at Alpine Linux maybe to try to reduce the size later, but I'm not sure if that would just increase complexity with getting things working)
from slackemon.
I think that sounds perfect!
from slackemon.
Postgres should now be working in https://github.com/tdmalone/slackemon/tree/data-store as an option for SLACKEMON_DATA_STORE_METHOD
. I just need to test this on Heroku and then will probably push it to master and bump to v0.0.39.
This partially implements point 2 (Postgres data store ability) mentioned above at #21 (comment)
The rest of point 2 (using Postgres on Docker) will be covered by using Docker Compose.
Point 3 (file locking) is probably the next priority, then point 1 (augment AWS cache with local cache).
Of course, Postgres isn't implemented properly at this stage - we're basically treating it like a filesystem with each row being a 'file' and containing a big JSON string. In future we should completely rewrite this, drop support for a local data store, and use the database properly.
from slackemon.
- Automatically create database if it doesn't exist yet, for example when run in a new Docker setup
- Data caching appears it might be broken at the moment, may have been a regression caused by the work in this ticket so far, need to look into
- Fix regression with
$action
not sending through full data anymore - Verify that
slackemon_get_files_by_prefix()
is returning in alphanumeric order when the database storage is being used
- Docker Compose (see #35)
- Initial file locking work
- Basic file locking
- Make locking an optional variable for now, until it is improved
- User feedback if waiting for a lock to become available
- Make locking more intelligent to only lock when writing is just about to happen
- Augment AWS cache with local cache
from slackemon.
Most of the work this ticket asks for is now in master!
A few more things to look into to make file locking more robust:
- Timeout if lock takes too long to acquire
- Is it worth implementing a queueing system rather than just the first try after lock is available?
- Is it worth trying to make file_exists() then file_put_contents() atomic? (Probably possible with DB, but what about local filesystem?) Potentially look into locks with flock() and fopen()'s modes.
from slackemon.
In addition to the above, there probably needs to be a regular cronned check to expire locks that did not get removed properly - probably after 2 minutes? Or even 1 minute.
from slackemon.
Related Issues (20)
- Use composer for AWS SDK HOT 2
- Need to set up data cache on AWS HOT 1
- Ensure initial use on a new deployment is error-free HOT 2
- Prevent users from running key commands HOT 1
- Make optional settings changeable via environment variables HOT 1
- Special and speed stats aren't easily viewable in mobile mode
- Larger sample icon needed for Slack app HOT 3
- Need to re-implement a method for locking out employees while working
- Clean source code with a set of code standards
- Code coverage needs increasing HOT 1
- Function complexity needs decreasing HOT 4
- File/folder (and some function) structure needs slight redesigning HOT 3
- Need good default error reporting settings HOT 1
- Pruning of stale spawn, battle and move data HOT 2
- Pokeapi is shutting down - Slackémon needs an alternative HOT 4
- Decide on a git branch strategy HOT 2
- Travis jobs have stopped generating coverage reports
- Nidoran male & female animated sprites aren't loading HOT 1
- Pokemon emojis not loaded on playslackemon.slack.com HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slackemon.