Commit Graph

55 Commits

Author SHA1 Message Date
R Tyler Croy 23c2d64eef Correctly match capabilities when the agent has more than the project 2023-03-12 20:56:26 -07:00
R Tyler Croy 0d00fb4cfd Implement support for inline commands definition for projects
I think this will help the task definitions that don't line up to a development
project
2023-03-12 19:50:37 -07:00
R Tyler Croy f8976aab10 Switch the demo over to using a directory for configuration 2023-03-12 19:50:37 -07:00
R Tyler Croy 9b516a8e5a Refactor the ServerConfig to allow for loading configuration from a directory
This makes it possible to load fragments of configuration into one large
configuration struct (ServerConfig). This will be really useful for
incrementally dropping configuration with a configuration management tool or
just git
2023-03-12 19:50:37 -07:00
R Tyler Croy 43d8cc19e8 Adding a synchronik.d/ directory for spacing out the yaml configuration
This isn't properly being loaded yet, but when the server is configured with a
directory, it should recurse through the YAML in the directory and merge it all
2023-03-12 19:50:37 -07:00
R Tyler Croy c709b8042f Properly render the agent name
This render_compact work is still half-finished, but I'm focused elsewhere at
the moment and will come back to the idea of view components later
2023-03-12 19:50:37 -07:00
R Tyler Croy 6cc263aae4 Add shoreman.sh and a Procfile for easily running a local setup 2023-03-12 19:50:37 -07:00
R Tyler Croy 8e600ba3b6 Rename the project to Synchronik 2023-03-12 19:50:37 -07:00
R Tyler Croy 3b95ff87ad
Regenerate API Docs 2023-02-06 14:25:11 -08:00
R Tyler Croy c02f87ae19
cargo clippy --fix 2023-02-05 16:27:05 -08:00
R Tyler Croy 1339c8c2e8
Refactor the dao module into a directory full of models
This will make it a lot easier for myself and new folks to navigate the tree. No
sense shoving everything into a single module.
2023-02-05 16:25:30 -08:00
R Tyler Croy dbfd92614a
Start refactoring structs out into modules for cleaner code 2023-02-04 22:23:52 -08:00
R Tyler Croy 6d8e7d1b6b
checkpoint wip on components rendering 2023-01-30 22:21:15 -08:00
R Tyler Croy 9506a78da9
Cleanup nav and start preparing for WebSockets 2023-01-30 12:56:35 -08:00
R Tyler Croy c94c8b3aed
Redirect on form submission for the execution 2023-01-29 22:23:28 -08:00
R Tyler Croy 72935aef37
Consolidate the API docs into a single spec file for ease of testing 2023-01-29 21:44:43 -08:00
R Tyler Croy 81451f888c
Render projects from the database and starting in on the Project page 2023-01-29 21:33:54 -08:00
R Tyler Croy 641c774788
Checkpointing work plugging projects through to the home page 2023-01-29 20:56:12 -08:00
R Tyler Croy f7a3dc3e8d
Display the configured agents on the home page 2023-01-29 20:56:12 -08:00
R Tyler Croy fcdf259bb9
Refactor some of the work with Project to create them from the config
Forgot to commit this earlier before wrapping up the stream
2023-01-29 20:50:59 -08:00
R Tyler Croy c4df9ad3af
Create the projects records from the configuration to make the foreign keys all work
With this the database is ready to start creating records based on user behavior
2023-01-29 18:06:00 -08:00
R Tyler Croy 7fc0902d4c
Add the projects table to keep track of the projects configured 2023-01-29 17:42:06 -08:00
R Tyler Croy 09ed646c76
Implement some JANKY AF data access layers
Things I've learned today:

* The [sqlx
  documentation](https://docs.rs/sqlx/0.6.2/sqlx/sqlite/types/index.html#uuid)
  is *lying* about its `uuid` support. Basically `query_as!` does not
  ser/deserialize `Uuid` properly in/out of Sqlite with `TEXT` _or_ `BLOB`
* There are [no useful
  examples](https://github.com/launchbadge/sqlx/issues/1014) of doing nested
  struct queries in sqlx at the moment
2023-01-29 17:28:40 -08:00
R Tyler Croy 8c63bf6095
Preserve line-breaks for testing 2023-01-29 14:32:08 -08:00
R Tyler Croy 3ecf9eef9e
Fix the yaml to be better yaml 2023-01-29 14:30:43 -08:00
R Tyler Croy dda839a50d
Add a multi-line command for testing 2023-01-29 14:23:43 -08:00
R Tyler Croy c0970ba7b7
Add tango icons 2023-01-28 22:48:42 -08:00
R Tyler Croy 99aaa368da
Add bootstrap to start building out some nice views 2023-01-28 22:43:57 -08:00
R Tyler Croy e8507f5b5f
Add bootstrap 5.3.0-alpha1 2023-01-28 22:22:36 -08:00
R Tyler Croy 705a7fffa9
Clean up some warnings from rustc 2023-01-28 22:14:45 -08:00
R Tyler Croy c256be98d8
List the configured projects on the home page
Calling this for the night, since the path to views for projects is pretty
straightforward, and will be easy to pick back up later and get into the swing
of things
2023-01-28 21:43:47 -08:00
R Tyler Croy ceb24a296a
Fetch capable agents and execute workloads on them
This makes the basic end-to-end example work. There's now a flow of the scripts
being pulled from the ci.janky.yml and executed on an agent with the right
capabilities

🎉
2023-01-28 21:33:26 -08:00
R Tyler Croy c386f34697
Eschew Jenkinsfile compatibility in favor of dumbass yaml for now 2023-01-28 20:42:37 -08:00
R Tyler Croy 19126ed88b
Refactor the project configuration to take in a github configuration
This allows for fetching the Jankyfile directly via REST API so the server
doesn't have to do any Git work just yet
2023-01-28 20:33:20 -08:00
R Tyler Croy 909dbe587d
Prototype fetching just the Jankyfile from GitHub for execution 2023-01-28 19:55:58 -08:00
R Tyler Croy 6c9f7ab491
Add a simple Jankyfile for testing 2023-01-28 19:39:42 -08:00
R Tyler Croy 05fb2d5889
Parse command and configuration file options for the server
This allows Janky to start setting up projects and agents
2023-01-28 19:36:20 -08:00
R Tyler Croy eea8fbf8a9
Refactored the work execution into its own task governed by a bounded channel
The bounded channel prevents too many things from trying to be executed, but at
the moment the API will not return a 409 unless there are *two* subsequent
requests while work is being done
2023-01-28 18:35:37 -08:00
R Tyler Croy 433239f47d
Output the logs to the file and return the log URL to the server 2023-01-28 17:46:50 -08:00
R Tyler Croy b47b1943cd
Actually execute whatever commands the agent receives 😱 2023-01-28 17:08:53 -08:00
R Tyler Croy 6d963464cf
Process the CommandRequest from the OpenAPI Spec in the execute handler
This is where the rubber starts to meet the road
2023-01-28 16:54:01 -08:00
R Tyler Croy cc8cc30b17
Define the /execute API in the agent spec 2023-01-28 16:47:53 -08:00
R Tyler Croy ed96899c6c
Some basic capabilities with a bungled trait implementation
I would like these traits to make this more dynamic or compact, but I don't have
the time to get it right today
2023-01-28 16:35:28 -08:00
R Tyler Croy 5494a54483
Start implementing the API documentation and stubs for agent APIs 2023-01-28 15:43:29 -08:00
R Tyler Croy 0e3f874870
Start in on implementing the OpenAPI for the agent side of the equation 2023-01-28 15:31:04 -08:00
R Tyler Croy 59c01e0e34
cargo clippy --fix 2023-01-28 15:10:48 -08:00
R Tyler Croy bd33634d04
Add a simple Tide scaffold for the agent 2023-01-28 15:10:20 -08:00
R Tyler Croy bb154cb92a
Oops, re-commited the root main.rs 2023-01-28 15:05:50 -08:00
R Tyler Croy 2789850f5b
Add multiple targets for server and agent, start implementing migrations 2023-01-28 15:05:05 -08:00
R Tyler Croy 0a3b14b942
Add the SqlitePool to the AppState for Janky data storage 2023-01-28 14:49:02 -08:00