GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — 2. Setup for Local API Development 2. Setup for Local API Development
adfarth edited this page
The setup steps are this page are meant to be performed sequentially. After cloning the API, you must set up your keys.py. Please pull the latest code if you did not just clone the repository.
Within the directory into which you cloned the REopt API is a file called v3 of the REopt API may be used with the following open source solvers: HiGHS, Cbc, and SCIP. To use one of these, you must specify which solver in the Once you have your keys.py and solver set up, install docker (https://www.docker.com/get-started) and create an account so that you are able to pull images from docker hub. Before building docker images, make sure the docker application is open. Choose the right instructions for your purpose:
The officially-registered REopt Julia package is the Build docker images, by entering the following in a terminal in the top directory of the REopt_API: or e.g. for a separate Xpress Docker setup: This step is only required the first time or if the images have changes or were removed. This will take some time to build (~10 minutes), and when it finishes you should see the images listed when you type Start the containers (anytime the containers are stopped or removed, or your computer sleeps/hibernates/restarts) with: or e.g. for a separate Xpress Docker setup: This should be pretty quick, but you have to wait for the containers to start running (Check Docker Desktop, another Docker UI, or type Once built, all containers should appear as green and "running" in the docker GUI.
Then, in the Docker plugin in VSCode or Docker Desktop: attach shell to the julia_api container. (If in VSCode, click the whale, right click the "julia_api" container and click "Attach Shell") From within the attached shell, spin up Julia, activate this julia_src directory, and point to the chosen feature branch of the REopt API: (replace The step above will modify the REopt_API
Once built, all containers should appear as green and "running" in the docker GUI.
If you do not have write access to REopt.jl or want to use a locally-modified version of REopt.jl, follow these instructions for spinning up docker. Instead of using the default
Once you are done testing your local changes to the Julia package, reset the Docker containers are meant to be ephemeral, only persisting for the required development and testing. When you are finished with them, it is good practice to stop and remove them. Stop your docker containers with (cntrl/cmd+c). The command below removes containers, and removes the database which is stored in a docker volume (-v). For open source solver users: For Xpress users: To remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes, run (see documentation: The next time you want to run the app, start at the If you installed docker-compose via Docker Desktop the default memory limits for the If you are already running PostgreSQL or Redis when you start the docker containers then you may get a conflict with the ports that PostgreSQL and Redis use. To fix this you can either shut down your PostgreSQL and/or Redis servers or change the port numbers in the docker-compose.yml file. For more on ports see the Docker documentation. If you are having trouble getting the API setup with Docker after you've attempted it the first time, it is suggested to start from scratch with the images and containers: To check if all the containers are running as expected, run the following command: You can interactively run commands in a docker container with: where container names can be found via For instructions on running tests when logged into the After you've attempted it the first time, it is suggested to start from scratch with the images and containers: Stop and remove all docker containers and volumes For open source solver: For Xpress solver: Delete all docker images and build cache (WARNING: this will remove any images even if not associated with the REopt API) Remove selected images to avoid wiping non-REopt API images First get a list of the images Then do this for each of the REopt API images: Check that everything is wiped You should see zeros across the board (unless you only removed selected images). There may be a dangling volume still, in which case you can: Windows docker image build issue Specifically for Windows operating machines, if you encounter an error which includes “bash^M”, run the following line of code in git bash terminal inside of your repository directory. You may need to repeat for each branch you work on... Clone this wiki locally |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |