Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ci deploy remote host #359

Merged

Conversation

j4qfrost
Copy link
Collaborator

@j4qfrost j4qfrost commented Oct 1, 2024

This will redeploy frontend and backend images pulled from an environment file provided in the secrets.

j4qfrost and others added 30 commits August 26, 2024 05:43
Now using go 1.23! Tested this on dev, it works
Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt
* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>
* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.
* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>
* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <patrick.del@gmail.com>
)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)
* add failure condition test

* Add test for HandleHTTPError (openpredictionmarkets#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>

* add failure condition test (openpredictionmarkets#282)

* Creation of Market Price Projection API (openpredictionmarkets#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (openpredictionmarkets#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>

* Frontend fixes (openpredictionmarkets#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <patrick.del@gmail.com>

* Attempting toa ddress cors related security concern. (openpredictionmarkets#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (openpredictionmarkets#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* remove wsl check

* remove watcher

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>
Co-authored-by: Patrick Delaney <patrick.del@gmail.com>
Co-authored-by: Marko Kovač <124689071+markokovac16@users.noreply.github.com>
Co-authored-by: Arthur <25300182+ajlacey@users.noreply.github.com>
* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

* add frontend file polling for wsl2

* Add test for HandleHTTPError (openpredictionmarkets#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>

* add failure condition test (openpredictionmarkets#282)

* Creation of Market Price Projection API (openpredictionmarkets#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (openpredictionmarkets#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>

* Frontend fixes (openpredictionmarkets#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <patrick.del@gmail.com>

* Attempting toa ddress cors related security concern. (openpredictionmarkets#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (openpredictionmarkets#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* revert

* feat(frontend): Compiles frontend into single js file for performance

* forgot merge

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>
Co-authored-by: Patrick Delaney <patrick.del@gmail.com>
Co-authored-by: Marko Kovač <124689071+markokovac16@users.noreply.github.com>
Co-authored-by: Arthur <25300182+ajlacey@users.noreply.github.com>
j4qfrost and others added 9 commits October 6, 2024 12:35
* Update README.md

Rewrote README to look more sales-friendly and less plain

* Update CONTRIBUTING.md

Added instructions for how to name a branch properly and added links to our Issues tab and Code of Conduct
…ionmarkets#353)

* Move Email and APIKey to PrivateUser fields, and embed PrivateUser into User

* Remove unused field ApiKey from test user

* Add documentation comment to ValidateTokenAndGetUser function

* Adjust instantiation of user private fields

* Remove PrivateUserResponse type for redundancy

replace it with models.PrivateUser call.
remove helper for getting private info out of the user type.
directly embed the private fields into the response.
* Make PublicUser type and embed it into User type

* Update User instations to use the PublicUser type

* Replace PublicUserType with models.PublicUser type (openpredictionmarkets#355)
…s#364)

* Adding image.

* updaing contribution guideline and readme again with kenyon name.
* add failure condition test

* Add test for HandleHTTPError (openpredictionmarkets#278)

* add test for HandleHTTPError

undelete

* more verbose http codes

* Update Dockerfile

Now using go 1.23! Tested this on dev, it works

* Update compose_dev.sh

Prints initial settings as defined in setup.yaml. Added for usability reasons - users keep getting confused about account balance and maximum allowable debt

* add failure condition test

* formatting and test standards

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>

* add failure condition test (openpredictionmarkets#282)

* Creation of Market Price Projection API (openpredictionmarkets#277)

* Moving test to appropriate location.

* Updating, including moving test location. Test not passing due to precision error but generally passing on the terminal up to 6 dits.

* market projection handler, not working.

* Update market projected probability.

* Safe uint conversion.

* Updating, adding noop change to push into pipeline.

* Update, test passing.

* Update, attempting to solve type converstion uint problem.

* Adding projected market layout.

* Update, still have react JSON parse error but layout added to buyshares.

* Market projection updates on buy shares side, upon button press.

* Update, change printf to print.

* Create SECURITY.md

* Adding Fees to Buying and Selling Bets (openpredictionmarkets#287)

* Drafting out fees deduction functions and capability.

* Attempting working version of initialBetFee function.

* Draft adding fees.

* Update, adding tests.

* Adding working test for GetBetsForMarket

* Successful fee util test.

* Fees added on backend, tests passing.

* Updating such that user record submitted. However fee summing not working yet evidently.

* Working fees, at least initial fees.

* Updating test scenario passing, made more clear.

* Update Dockerfile

We need to switch to 3.0.14-1~deb12u2

* Removing logging.

* Adding fees, including communicating fees on front end.

* totalBetCount to userBetCount so as not to misconstrue meaning.

* Simplifying function, test passed.

* Simplifying naming.

* Updating new function name in test

* Changing test to got before want convention.

* Update marketid variable

* Add combined fee structure for more througough test.

* Reverting sale amount to 1 share.

* Reversing got want

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>

* Frontend fixes (openpredictionmarkets#286)

* fix: fixed the market buttons not showing on mobile

* fix: removed trade button on closed market

---------

Co-authored-by: Patrick Delaney <patrick.del@gmail.com>

* Attempting toa ddress cors related security concern. (openpredictionmarkets#298)

* Drafting out reporting stats.

* Add support for dependency injection to setup (openpredictionmarkets#301)

* Make EconomicsConfig from component structs

Auto initialize config
Add support to inject config
Add support for testing the setup through test doubles
Use new fee for placing bets (EachBetFee)

* fix(ci): Doc check skip

* not

---------

Co-authored-by: Osnat Katz Moon <137817983+astrosnat@users.noreply.github.com>
Co-authored-by: Patrick Delaney <patrick.del@gmail.com>
Co-authored-by: Marko Kovač <124689071+markokovac16@users.noreply.github.com>
Co-authored-by: Arthur <25300182+ajlacey@users.noreply.github.com>
@j4qfrost j4qfrost force-pushed the feature/ci_deploy_digital_ocean branch from 82a1481 to a0989c6 Compare October 6, 2024 19:35
@j4qfrost j4qfrost marked this pull request as ready for review October 6, 2024 19:56
Copy link
Collaborator

@astrosnat astrosnat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks awesome. My question is: what will happen if someone is deploying an instance not on Digital Ocean, say AWS or something? Will they have an option to not use this script? Or are we going to have to change the staging documentation and say that Digital Ocean is required for deploying any staging instance?

@j4qfrost
Copy link
Collaborator Author

j4qfrost commented Oct 7, 2024

Thanks, this looks awesome. My question is: what will happen if someone is deploying an instance not on Digital Ocean, say AWS or something? Will they have an option to not use this script? Or are we going to have to change the staging documentation and say that Digital Ocean is required for deploying any staging instance?

So I actually originally wrote this with the intention of using Digital Ocean specific commands, but now that I'm look at it, this workflow can work with any VM that is reachable via ssh. I can rename the file, and repush.

@astrosnat
Copy link
Collaborator

@j4qfrost yes if you rename and repush I'll approve

@j4qfrost j4qfrost changed the title Feature/ci deploy digital ocean Feature/ci deploy remote host Oct 7, 2024
@j4qfrost j4qfrost merged commit d400cc0 into openpredictionmarkets:main Oct 7, 2024
2 checks passed
@j4qfrost j4qfrost deleted the feature/ci_deploy_digital_ocean branch October 7, 2024 09:41
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.

5 participants