mathesar icon indicating copy to clipboard operation
mathesar copied to clipboard

First time setup script

Open abhishak3 opened this issue 2 years ago • 3 comments

Fixes #874

Technical details replaced all the commands used for first-time setup with a single "make init" command.

"make init" command is defined in the Makefile which executes a bash script "initial_setup.sh" with root privileges. The reason for running the script with root privileges is that the docker needs root privileges to run, otherwise it shows a "Permission denied" error. This error is user-specific and depends on the way docker is configured on their system.

Checklist

  • [x] My pull request has a descriptive title (not a vague title like Update index.md).
  • [x] My pull request targets the master branch of the repository
  • [x] My commit messages follow best practices.
  • [x] My code follows the established code style of the repository.
  • [ ] I added tests for the changes I made (if applicable).
  • [x] I added or updated documentation (if applicable).
  • [x] I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

abhishak3 avatar Jul 28 '22 17:07 abhishak3

@dmos62 I would like to know what should be the timeout limit for the script. For the first-time setup, it can take several minutes to hours depending on the system. So, should we even keep the timeout or completely remove it?

abhishak3 avatar Jul 30 '22 18:07 abhishak3

@abhishak3 hm, I'm not very familiar with the container startup process, but I was under the impression that you don't actually need Django ready to serve requests to perform migrations and run the installation script.

Try it out without the timeout. If it turns out to be necessary, I'm guessing that a 60 second timeout is good enough for now.

dmos62 avatar Aug 02 '22 08:08 dmos62

@dmos62 I've made the requested changes. Please check 'em out.

abhishak3 avatar Aug 03 '22 19:08 abhishak3

Assigning this to @mathemancer since @dmos62 is out sick.

kgodey avatar Aug 16 '22 20:08 kgodey

I think GitHub automatically requested a review from me for this PR because it modifies front end files within mathesar_ui. @abhishak3 Can you remove the changes to package-lock.json from this PR? That file gets changed sometimes by Docker when starting up, but we shouldn't put those changes in this PR.

removed changes to the package-lock.json from the PR.

abhishak3 avatar Aug 17 '22 05:08 abhishak3

Codecov Report

Merging #1486 (6835c4b) into master (c770352) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1486   +/-   ##
=======================================
  Coverage   92.61%   92.61%           
=======================================
  Files         142      142           
  Lines        6348     6348           
=======================================
  Hits         5879     5879           
  Misses        469      469           
Flag Coverage Δ
pytest-backend 92.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Aug 24 '22 08:08 codecov-commenter

@abhishak3 thanks for the contribution! I'm merging this in. I'll make a few changes to the blocking conditions in a separate PR. I'll post a link.

dmos62 avatar Aug 24 '22 11:08 dmos62