Skip to content

Update Install Procedures#589

Merged
pwdel merged 3 commits intomainfrom
feature/socialpredict-install
Nov 18, 2025
Merged

Update Install Procedures#589
pwdel merged 3 commits intomainfrom
feature/socialpredict-install

Conversation

@ntoufoudis
Copy link
Collaborator

@ntoufoudis ntoufoudis commented Nov 10, 2025

What changed:

  • Running ./SocialPredict without any command, or with an invalid command, will print some basic help message.

  • Running any valid ./SocialPredict command except install, will check if the .env file is present. If it is not, it will advise to run ./SocialPredict install to initialize the app and then exit.

  • Running ./SocialPredict install, will force user to perform a clean install. That means it will ask to re-create the .env file, and remove the db files. If user denies any of the above, the script will fail.

  • The ./SocialPredict install command now accepts some arguments:

    • -e "Environment"
    • -d "domain"
    • -m "email"
      For -e acceptable values are development, localhost, production. Running the script with the above arguments, will force re-creation of .env and db files, and is only meant to be used by the ansible deployment procedures. It is not safe for usage by end user.
  • There has been a lot of refactoring and clean up in the scripts regarding the installation procedure.

@ntoufoudis ntoufoudis requested a review from pwdel November 10, 2025 16:48
@ntoufoudis ntoufoudis self-assigned this Nov 10, 2025
@ntoufoudis ntoufoudis marked this pull request as ready for review November 10, 2025 17:26
@astrosnat
Copy link
Collaborator

tested on dev and localhost, looks good to me

@pwdel
Copy link
Member

pwdel commented Nov 18, 2025

@ntoufoudis sorry for the delay.

I tested on brierfoxforecast.com manually using your branch, which you can find under socialpredict-deploy if you log in to the digital ocean droplet.

When logging in as user test using the standard password Password1, and trying to access the user profile I get:

Error fetching portfolio: Error: Failed to fetch portfolio

Not sure if this is an application error or due to the new installation.

Other than that, it works on demo/stage.

Need to test locally still.

@pwdel
Copy link
Member

pwdel commented Nov 18, 2025

Ok on local (MacOS) tried this and got an error.

% ./SocialPredict install --h
[INFO] Checking that docker compose is installed...
[INFO] Found docker compose.
Invalid option: --
Invalid option: -h
/Users/patrick/Documents/Projects/socialpredict/scripts/install.sh: line 408: env: unbound variable

Note that:

% ./SocialPredict
Usage: ./SocialPredict COMMAND

Commands:
  install     Initialize SocialPredict
  up          Start SocialPredict containers
  down        Stop SocialPredict containers
  exec        Execute command on SocialPredict containers
  backup      Backup operations on SocialPredict

Run './SocialPredict COMMAND --help' for more information on a command.

For more help on how to use SocialPredict, head to https://github.com/openpredic
% ./SocialPredict install --help
[INFO] Checking that docker compose is installed...
[INFO] Found docker compose.
Invalid option: --
Invalid option: -h
[ERROR] Wrong environment selection.
[INFO] Acceptable environments: 'development', 'localhost', 'production'

@pwdel
Copy link
Member

pwdel commented Nov 18, 2025

Ok ran ./SocialPredict Install on MacOS attempting development environment.

% ./SocialPredict install
[INFO] Checking that docker compose is installed...
[INFO] Found docker compose.
.env file found. Do you want to re-create it? (y/N) y
[INFO] .env file re-created successfully.
[INFO] Building and Deploying SocialPredict ...

### Select Application Environment:
1) Development
2) Localhost
3) Production
4) Quit
Please enter your choice: 1
[INFO] Searching for Docker Images ...
### Checking for socialpredict-dev-backend Image ...
socialpredict-dev-backend Image Found. Do you want to re-build it? (y/N) y
Deleting Image ...
Untagged: socialpredict-dev-backend:latest
Deleted: sha256:9ec0a277535ba068226fe10e66dbc63fd589bc67c107b780c4d786cd02071dc4
Image Deleted.
Building socialpredict-dev-backend now.
[+] Building 47.8s (11/11) FINISHED                        docker:desktop-linux
 => [internal] load build definition from Dockerfile.dev                   5.4s
 => => transferring dockerfile: 280B                                       5.3s
 => [internal] load metadata for docker.io/library/golang:1.25.1-alpine3.  0.7s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [1/6] FROM docker.io/library/golang:1.25.1-alpine3.22@sha256:b6ed3fd0  0.0s
 => => resolve docker.io/library/golang:1.25.1-alpine3.22@sha256:b6ed3fd0  0.0s
 => [internal] load build context                                          5.1s
 => => transferring context: 13.15kB                                       5.1s
 => CACHED [2/6] WORKDIR /src                                              0.0s
 => [3/6] RUN go install github.com/air-verse/air@latest                  23.8s
 => [4/6] COPY backend/go.mod backend/go.sum ./                            0.1s
 => [5/6] RUN go mod download                                              9.8s
 => [6/6] COPY docker/backend/entrypoint.dev.sh /entrypoint.sh             0.0s
 => exporting to image                                                     7.9s
 => => exporting layers                                                    7.8s
 => => exporting manifest sha256:828b925c206aa6546fadc318137ea57ce2c9eacc  0.0s
 => => exporting config sha256:2f5cd445f4a4d96f2937393f8c899affb7526ea809  0.0s
 => => exporting attestation manifest sha256:5b62b1c8e91bbf54fdf995ef7daa  0.0s
 => => exporting manifest list sha256:95ea3002d72b37124a5f46b5d6ef23252ec  0.0s
 => => naming to docker.io/library/socialpredict-dev-backend:latest        0.0s
socialpredict-dev-backend Image Built.
### Checking for socialpredict-dev-frontend Image ...
socialpredict-dev-frontend Image Found. Do you want to re-build it? (y/N) y
Deleting Image ...
Untagged: socialpredict-dev-frontend:latest
Deleted: sha256:7783d1d04787400e47423d331c9e796c899f97d1c2328849ec3f5fb4c3b55906
Image Deleted.
Building socialpredict-dev-frontend now.
[+] Building 12.3s (11/11) FINISHED                        docker:desktop-linux
 => [internal] load build definition from Dockerfile.dev                   2.9s
 => => transferring dockerfile: 276B                                       2.9s
 => [internal] load metadata for docker.io/library/node:22.20.0-alpine3.2  0.5s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [1/6] FROM docker.io/library/node:22.20.0-alpine3.22@sha256:dbcedd8ae  0.0s
 => => resolve docker.io/library/node:22.20.0-alpine3.22@sha256:dbcedd8ae  0.0s
 => [internal] load build context                                          2.5s
 => => transferring context: 1.39MB                                        2.5s
 => CACHED [2/6] WORKDIR /app                                              0.0s
 => [3/6] COPY frontend/package.json frontend/package-lock.json ./         0.0s
 => [4/6] RUN npm install                                                  3.9s
 => [5/6] COPY frontend/ .                                                 0.1s
 => [6/6] COPY docker/frontend/entrypoint.dev.sh /entrypoint.sh            0.0s
 => exporting to image                                                     2.3s
 => => exporting layers                                                    2.3s
 => => exporting manifest sha256:84767df5c2681e7902299ca0f1a7690ec32399b3  0.0s
 => => exporting config sha256:f5146cd39d7a45412a865f201ee6a6a3472aae6c04  0.0s
 => => exporting attestation manifest sha256:d70be874ec6950d93ed333a8c35a  0.0s
 => => exporting manifest list sha256:5d5c96344704398925d8be57f802a08da2e  0.0s
 => => naming to docker.io/library/socialpredict-dev-frontend:latest       0.0s
socialpredict-dev-frontend Image Built.

Images built.
Use ./SocialPredict up to start the containers
And ./SocialPredict down to stop them.

Then:

% ./SocialPredict up
[INFO] Checking that docker compose is installed...
[INFO] Found docker compose.
[INFO] Loading configuration from .env file
Using compose file: /Users/patrick/Documents/Projects/socialpredict/scripts/docker-compose-dev.yaml
[+] Running 6/6
 ✔ Network socialpredict_dev_network                Created                0.0s
 ✔ Volume "scripts_pgdata"                          Created                0.0s
 ✔ Volume "scripts_socialpredict_dev_node_modules"  Created                0.0s
 ✔ Container socialpredict-postgres-container       Healthy                8.8s
 ✔ Container socialpredict-backend-container        Started                8.9s
 ✔ Container socialpredict-frontend-container       Started                4.7s
SocialPredict may be found at http://localhost:5173 .
This may take a few seconds to load initially.
Here are the initial settings. These can be changed in setup.yaml
economics:
  marketcreation:
    initialMarketProbability: 0.5
    initialMarketSubsidization: 10
    initialMarketYes: 0
    initialMarketNo: 0
    minimumFutureHours: 1.0
  marketincentives:
    createMarketCost: 10
    traderBonus: 1
  user:
    initialAccountBalance: 0
    maximumDebtAllowed: 500
  betting:
    minimumBet: 1
    maxDustPerSale: 2
    betFees:
      initialBetFee: 1
      buySharesFee: 0
      sellSharesFee: 0

frontend:
  charts:
    sigFigs: 4

Everything else worked.

We still had the profile problem so this does seem to be a problem with the business logic. I think this will have already been fixed in a parallel PR (moving to services).

image

@pwdel pwdel merged commit 1178cd3 into main Nov 18, 2025
8 checks passed
pwdel added a commit that referenced this pull request Nov 30, 2025
@pwdel pwdel mentioned this pull request Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants