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

Document GradleRIO predeploy task for running commands before robot program deploy and start #1150

Open
calcmogul opened this issue Jan 25, 2021 · 4 comments

Comments

@calcmogul
Copy link
Member

calcmogul commented Jan 25, 2021

The following gradle-fu I learned from @ThadHouse is very useful for running commands as admin on the roboRIO before the robot program deploys and starts. We should document it. (Note that the robot program is deleted at this point.)

deploy {
    ...
    artifacts {
        frcNativeArtifact('frcCpp') {
            ...
            predeploy << {
                // Give RT capability
                it.execute('setcap cap_sys_nice+eip /home/lvuser/frcUserProgram')

                // Disable crond because it uses 50% CPU and there's no cronjobs to run
                it.execute('/etc/init.d/crond stop')

                // Disable NI web server because it leaks memory badly
                it.execute('/usr/local/natinst/etc/init.d/systemWebServer stop')

                // Compress old log files
                it.execute('find . -type f | grep \\.csv$ | xargs -d \\n gzip -q')
            }
        }
@Daltz333
Copy link
Member

Daltz333 commented Jan 25, 2021

Not sure where to put this and #1151. Maybe in an "Advanced Gradle Configuration" section under something.

@Starlight220
Copy link
Member

Starlight220 commented Jan 26, 2021

I'm thinking of an "Advanced Gradle Configuration" section in the GradleRIO docs, not frc-docs. A few examples came into discussion on Discord yesterday. However, I didn't get @ThadHouse's thoughts about it.

@Daltz333
Copy link
Member

There was debate in the slack chat, but it seemed that @PeterJohnson and Tyler agreed that it was user- facing. Setting C++ compiler args is common for C++ users.

@calcmogul calcmogul changed the title Document GradleRIO predeploy task for running commands before robot program start Document GradleRIO predeploy task for running commands before robot program deploy and start Jan 30, 2021
@Daltz333 Daltz333 added the Waiting On: WPILib Waiting on something from WPILib label Feb 11, 2021
@Daltz333
Copy link
Member

The API will be changing for 2022.

@sciencewhiz sciencewhiz removed the Waiting On: WPILib Waiting on something from WPILib label Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants